Also consider optimizing the page so it doesn't take 20 seconds to render - memcached should help you under load, and magnify capacity, but shouldn't be used as a crutch for poor design.
-Dormando On Wed, 5 Aug 2009, Adam Lee wrote: > Run a cron job that executes the query and updates the cache at an interval > shorter than the expiration time for the cached item. > > On Wed, Aug 5, 2009 at 11:38 AM, Haes <[email protected]> wrote: > > > > > Hi, > > > > I'm using memcached together with Django to speed up the database > > queries. One of my Django views (page) uses a query that takes over 20 > > sec. Normally this query hits the memcached cache and the data is > > served almost instantly. The problem now is that if the cache expires, > > the next person accessing this page will have to wait about 20 seconds > > for it to load which is not really acceptable for me. > > > > Is there a way to update the memcached data before it times out, in a > > way that this query always hits the cache? > > > > Thanks for any hints. > > > > Cheers. > > > > > > -- > awl >
