feincms/feincms — pull request #277 by jonasvp (2012-04-16 10:28:24+00:00)
Title: Allow configuring a cache key prefix for application contents

We use our own Page module, which mostly overlaps with the standard
model but implements multi-language capabilities (especially with
regards to _cached_url). This generally works very robustly but breaks
when using the application content module.

What happens is that app_reverse() goes ahead and caches the results of
get_absolute_url() for a page without regard for the currently set
language. This is a problem for us, as the result of get_absolute_url()
changes whenever the current language changes.

We currently solving this problem by monkeypatching feincms.content.application.models._local.reverse_cache to be a custom dictionary object that silently discards everything. Not ideal but it works.

The attached pull request introduces a setting to configure a function that is called
whenever a cache key is generated for the reverse cache. This function
must return a string to be prefixed to the cache key.

Custom Page modules might be out of scope for FeinCMS proper, in that case feel free to disregard this patch.