Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8607233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:17:59+00:00 2026-06-12T03:17:59+00:00

I generate RSS feed with latest 10 records from GAE NDB datastore. Records in

  • 0

I generate RSS feed with latest 10 records from GAE NDB datastore. Records in database are updated weekly. How can I avoid queries to datastore each time user requests RSS feed display? I.e. how to cache that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:18:01+00:00Added an answer on June 12, 2026 at 3:18 am

    You can use memcache to avoid hitting the datastore every time. As you probably know queries are not cached in NDB.

    https://developers.google.com/appengine/docs/python/memcache/usingmemcache

    def get_data():
      data = memcache.get('key')
      if data is not None:
          return data
      else:
          data = self.query_for_data()
          memcache.add('key', data, 60)
          return data
    

    So in other words, try to get your data from memcache and if it fails get it from the datastore then add it to memcache for next time round.

    The example above uses a 60 second timeout (the value 60 in the .add call) Simply leave that argument out to have the data persist as long as memcache allows.

    Also from a similar question: NDB Caching When Using Projected Queries

    key.get() will be cached and retrieved from cache, but query.get() won’t be retrieved from cache.
    https://developers.google.com/appengine/docs/python/ndb/cache

    From the docs: Queries do not look up values in any cache. However, query results are written back to the in-context cache if the cache policy says so (but never to Memcache).

    So it appears if you get by key you’ll automatically get from the NDB cache instead, if available, but I’ve not personally used that.

    So construct your RSS content and just before you render or it, save it to memcache. Then when you update the content it’s created from simply invalidate the cached version (see docs) so the next request will get it from the datastore and you can then put it back in the cache.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to generate a RSS feed from a mysql database I already
I'm using a CMS and found a function to generate a rss feed from
I'm using Java, and need to generate a simple, standards-compliant RSS feed. How can
How might one dynamically generate a temporary RSS feed, on the fly, from a
I have a requirement from client to generate RSS Feed for Posts and Articles.
I have this script to generate an XML file for an RSS feed. Works
I am trying to generate a full rss feed, however when loading the feed
I am using an excel macro to generate an RSS feed. The user's timezone
I've created a rudimentary RSSActionResult in ASP.NET MVC to generate an RSS feed based
I am trying to generate a Google Merchant RSS Feed, using PHP's SimpleXML and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.