Thanks for you reply. I'm away from my coding machine, so I'll just answer a
part of your question --

When I use the cache decorator in a view, I expect that as long as cache is
valid, the code in the view
does not get executed. And that's what I see when rendering a template with
some little context attached to it. However, in a different view adorned
with same decorator, which does not use a template and just wraps
HttpResponse around JSON (which is plain ASCII after all) I see that the
whole database glue shebang inside the view comes into motion every time I
hit the view, any time. This correlates with the content of the
CACHE_BACKEND (which in my case is file storage) -- in the former case, I
have cryptic little dirs sprouting up, in the latter I see nothing. I think
that proves the general picture i.e. cache not working -- am I wrong?



jtiai wrote:
> 
>> Hello,
>> 
>> I'm trying to use native caching in Django as per
>> http://docs.djangoproject.com/en/dev/topics/cache/
>> 
>> I followed the setup procedure to the tee (it's not hard, of course).
>> What
>> I observe is that my app caches only views that deliver HTML. Since my
>> application is heavily AJAX, that's not what I want -- I want to cache
>> JSON -- but it doesn't work!
> 
> It doesn't work how? How you observed caching?
> 
>> Any hints how I can make it work?
>> 
>> I can always code it up myself (I have, actually), but I try to avoid
>> that.
> 
> View code would be helpful and don't forget the caching parts.
> 
> -- 
> 
> Jani Tiainen
> 
> -- 
> 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.
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Caching-JSON-in-Django-tp29526535p29531180.html
Sent from the django-users mailing list archive at Nabble.com.

-- 
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.

Reply via email to