Princeton-CDH / derrida-django

Derrida's Margins - Python/Django web application
https://derridas-margins.princeton.edu
Apache License 2.0
8 stars 1 forks source link

Set up Conditional View Processing (Last-Modified and/or ETag headers) #210

Closed meg-codes closed 3 years ago

meg-codes commented 6 years ago

Improve caching by setting Last-Modified versions of resources.

https://docs.djangoproject.com/en/2.0/topics/conditional-view-processing/

rlskoeser commented 6 years ago

We don't currently have any dates or other metadata to use to generate last-modified headers. We might be able to lean on Solr for that to at least get last indexed dates (which would be effectively what we need for most pages), but I'm not sure how to easily do that with haystack. Something to look at for later.

The Django ConditionalGetMiddleware doesn't get us much, since it still has to generate the view.