datamade / nyc-councilmatic

:statue_of_liberty: a web app for keeping tabs on city council activity in New York City
https://nyc.councilmatic.org
MIT License
38 stars 12 forks source link

Build partial caching for templates #208

Closed reginafcompton closed 7 years ago

reginafcompton commented 7 years ago

Wrap parts of the templates inside cache tags:

https://docs.djangoproject.com/en/1.10/topics/cache/#template-fragment-caching

Or find a more up-to-date way to do this:

http://www.holovaty.com/writing/django-two-phased-rendering/

fgregg commented 7 years ago

This seems like the main library for doing two-phased rendering https://django-phased.readthedocs.io/en/latest/tutorial.html

On Wed, Jan 25, 2017 at 11:06 AM, Regina Compton notifications@github.com wrote:

Wrap parts of the templates inside cache tags:

https://docs.djangoproject.com/en/1.10/topics/cache/# template-fragment-caching

Or find a more up-to-date way to do this:

http://www.holovaty.com/writing/django-two-phased-rendering/

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/datamade/nyc-councilmatic/issues/208, or mute the thread https://github.com/notifications/unsubscribe-auth/AAgxbVCNFN00btQg1XX8TZXD09oxK6Kyks5rV4EngaJpZM4Ltvfw .

-- 773.888.2718

reginafcompton commented 7 years ago

The django-phased library is not compatible with Django 1.6+, since it uses the deprecated django.utils.hashcompat module.

I think it might be easiest to just build our own custom middleware class, which does what the django-phased library does.

reginafcompton commented 7 years ago

Done some time ago.....