In one of the applications I maintain, I use a view that takes the
following inputs, crunches a lot of data from over the course of a
month, and spits out a view:

def month_detail(request, year, month, check=True):

This could be the current month, the previous month, a month 3 years
ago, etc. The information pertaining to the current month is updated
every 15 minutes (if there's been new data in the past 15 minutes), so
I would like to make that information only cache for 15 minutes at
most.  It would be super cool to invalidate the cache (or not) at the
moment I update the data, but it's not mission critical.  For someone
to visit the site every 15 minutes and get new data for the current
month is just fine.

However, the data for previous month's is done and set in stone pretty
much at the beginning of the next month.  Data for the previous month
might roll in for a few days into the new month, but in general, once
we roll into the new month, it's a done deal.  I would like to cache
those pages forever, or maybe invalidate their caches when the rare
bit comes in after the month is over.

Long story short, my current approaches haven't yielded any fruit. I'm
not sure that I can cache one view two different ways by using the
cache_page function.  Perhaps I need to dig a little deeper into the
caching mechanisms?

How would people with more experience with caching+Django approach
this situation?

Thanks in advance,
Clint

-- 
Clint Ecker
Sr. Web Developer - Stone Ward Chicago
p: 312.464.1443
c: 312.863.9323
---
twitter: clint
skype: clintology
AIM: idiosyncrasyFG
Gtalk: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to