Using etags for backend caching
Hey guys,
My project makes pretty heavy use of etags for browser-level caching,
but I'd like to go one step further and be able to cache pages on the
backend keyed by the page's etag.
As far as I can tell, none of the current built-in caching
middleware/decorators or conditional processing does this, but I don't
think it will be terribly hard to implement.
The logic would look something like this:
etag = calculate_etag(request)
if etag in cache:
return cache.get(etag)
else:
response = view(request, ...)
cache.set(etag, response)
return response
Does this seem feasible? Are there any major problems I'm missing? Has
someone already done it?
If no-one's done it before, and you think it sounds super useful, should
I write a generic enough version that I can put online for people to use?
Thanks for any input you can give.
Cheers!
Tom
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home