I am caching html within a few templates e.g.:
{% cache 900 stats %}
{{ stats }}
{% endcache %}
Can I access the cache using the low level library? e.g.
html = cache.get('stats')
I really need to have some fine-grained control over the template caching :)
Any ideas? Thanks everyone! :D
Looking at the code for the
cache
templatetag, the key is generated like this:so you could build something simliar in your view to get the cache directly: in your case, you're not using any
vary_on
parameters so you could use an empty argument tomd5_constructor
.This is how I access the template cache in my project:
The way I use the
cache
tag, I have:You probably just need to pass an empty list to
variables
. So, yourvariables
and cache_key
will look like: