On Nov 12, 2:22 pm, Mathieu Leduc-Hamel <marra...@gmail.com> wrote: > Hi all, > > I'm working on a e-commerce website and to make it work better we've > implemented a couple of caching strategy. But i was wondering, in our > system, we are using the cache middleware and the decorator to mark > some views as cacheable. > > But, loading multiple times the same view, it seems there's some > activities on the database side. > > I don't understand why, > > The view is very simple and we've just put something like that: > > @cache_page(3600) > def category(request, template=...) > > What's used there as key in the cache ? What's not working ? I've > already configure the middleware and make sure memcached is working > properly. > > What's not working ? >
It would have been useful to know what sort of db activity you're seeing. The culprit is most likely to be middleware. If you're caching at the view level, any request or response middleware is going to be outside of that, so its db access will not be cached. The obvious examples are the auth middleware, which will access the db to get the current logged-in user, and the session middleware, which will do the same for the user's session dictionary. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.