3👍
Check this app: https://github.com/codysoyland/django-phased and this blog post: http://www.holovaty.com/writing/django-two-phased-rendering/
2👍
I’m assuming you’re aware of template fragment caching – I don’t believe setting a lower value here will override a view-level cache set to a longer period, though. This of course would mean you’d have to cache different parts of your index.html separately, which is feasible but not likely what you want.
You might also look at the clearcache
tag for template fragments implemented here.
- [Django]-Django Authenticate always returns None with correct credentials also
- [Django]-How to use filter_horizontal on a ForeignKey between two apps using ContentTypes in Django admin?
- [Django]-DjangoRest Serializer returns empty object
- [Django]-Django Test – South migration reports 'no such table' but I can see said table in the db
1👍
You can’t, really. When you cache the whole view, Django doesn’t process it at all. It just returns the same response from the cache, which includes the fully formed HTML. You can add vary headers to the cache, but that won’t help you unless there’s something to vary on (logged in user, etc.). It won’t help with just a basic block of changing content not tied to anything else.
Remove the view-level caching and manually cache things in the view that you want. Otherwise, you’re out of luck.
- [Django]-What are these warning for cross-site cookie in my console?
- [Django]-Slow Celery Task Times
- [Django]-Redirect http to https safely for Heroku app
- [Django]-MemoryError with django
- [Django]-Xapian search terms which exceed the 245 character length: InvalidArgumentError: Term too long (> 245)