QuestionQ174

Ensuring solution and operations excellence

A news-feed web service is running the following code on Google App Engine. At peak load, users report seeing news articles that they have already viewed. What is the most likely cause of this issue?

Question Image

  • A The session variable is local to just a single instance
  • B The session variable is being overwritten in Cloud Datastore
  • C The URL of the API needs to be modified to prevent caching
  • D The HTTP Expires header needs to be set to -1 stop caching
Explanation

The sessions dictionary is process memory local to one application instance, rather than shared persistent session storage. App Engine can scale to multiple instances and route consecutive requests from the same user to different instances; an instance that lacks the user’s prior in-memory state treats the viewed list as empty and returns previously viewed articles. Google Cloud: How requests are handled

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!