0

On my site, there are several pages that make a large sample from the database, but updating them enough times a day, preferably at night. How to do it right?

I have already enable cache, the issue is to update it at a certain time.

Atterratio
  • 445
  • 2
  • 9
  • 25

1 Answers1

0

Did you try to set proper cache expire date? That should solve the problem.

EDIT:

Maybe the answer is here?

Community
  • 1
  • 1
tunarob
  • 2,768
  • 4
  • 31
  • 48
  • 'TIMEOUT' in settings.py? Yes now it's 86400, but I think it's not good, it can slide. – Atterratio Oct 14 '13 at 13:10
  • Hm, I was thinking about `cache.set('my_key', 'hello, world!', 30)` - 30 is the cache time. [docs](https://docs.djangoproject.com/en/1.5/topics/cache/#basic-usage) – tunarob Oct 14 '13 at 13:27
  • How do you cache them? Using the low-level cache API? – tunarob Oct 14 '13 at 14:32