ic-labs / django-icekit

GLAMkit is a next-generation Python CMS by the Interaction Consortium, designed especially for the cultural sector.
http://glamkit.com
MIT License
47 stars 11 forks source link

Prevent Navigation Item from caching old link targets #291

Open jmurty opened 7 years ago

jmurty commented 7 years ago

The NavigationItemPlugin and AccountsNavigationItemPlugin content plugins currently cache their output.

This is a problem because the rendered output will not be updated for some situations, for example if you change the URL location of a Page referenced by a NavigationItem the old URL will continue being rendered until you clear the cache.

The brute-force fix is to add the cache_output = False attribute to these plugins.

A better fix, and one we should start using in general, is to figure out how to generate a sensible cache key and override the get_output_cache_key() method of ContentPlugin so that we can benefit from caching but have that cache invalidated when appropriate.