Configurable cache key and page version
Hi,
As I started talking in the issue #5, it would be great to be able to configure the cache_key encryptation algorythm and the page version.
This way I can have pages cached for logged in and for logged out users.
Thanks for the contribution @michelts - sounds promising. Am on holiday at the moment, but will take a proper look when I'm back. I'd need to be sure it's 100% backwards compatible so that it doesn't break a couple of large builds that use it in production and spin up automatically.
Thanks @stevejalim, I will write some tests of the new funcionalities until that. I want to migrate the login in the cache decorator to the Middleware class: today, isn't possible to use it as a middleware, you need to use the decorator...
Good holiday ;)
Hi @michelts - sorry for the delay. Did those tests work out OK? (see above)
Cheers Steve
In fact, I'm using my branch in production. The only problem I have is for cache keys with more than 250 chars but it is not a problem of django-nginx-memcache.
I didn't want to compile nginx myself, at least not for now :)
I can write some tests during this week.
Hi @stevejalim!
All tests passing if I have default configurations. I also created 2 tests for the new functionalities.
Sorry the delay :)
Hi michelts
In addition to the page_version_fn note showin above, there's also an issue with the lack of a migration for your model change. As it is, unfortunately I can't merge this into our Torchbox master without breaking some of our production sites.
Are you in a position to address my queries? If so, please do get back to me. If not, I'll try to make some time to get your ideas into our master when I can.
Hi Steve,
I will fix the page_version_fn issue, thanks for pointing me out that. I will also create a South migration that starts just before my changes and has a second step with the key max_length update.
I'm sure I can do it until the next week!
Thanks Michel - those both sound like good plans. Thanks for being open to making the additional changes.
There's no urgent rush, so please don't worry if you don't have time to work on this for a while - it'll happen when it happens :o)
All the best Steve
Done ;)
Hi Steve,
I updated this pull request to be compatible with django 1.7!
Hi Michel
Thanks for this. I'm afraid I'm no longer the maintainer of this repo, but @nimasmi or @nealtodd may well be interested.
Many thanks, Steve