django-nginx-memcache icon indicating copy to clipboard operation
django-nginx-memcache copied to clipboard

Configurable cache key and page version

Open michelts opened this issue 13 years ago • 11 comments

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.

michelts avatar Feb 26 '13 17:02 michelts

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.

stevejalim avatar Feb 27 '13 10:02 stevejalim

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 ;)

michelts avatar Feb 27 '13 12:02 michelts

Hi @michelts - sorry for the delay. Did those tests work out OK? (see above)

Cheers Steve

stevejalim avatar May 17 '13 22:05 stevejalim

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.

michelts avatar May 19 '13 12:05 michelts

Hi @stevejalim!

All tests passing if I have default configurations. I also created 2 tests for the new functionalities.

Sorry the delay :)

michelts avatar Jun 12 '13 18:06 michelts

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.

stevejalim avatar Dec 03 '13 17:12 stevejalim

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!

michelts avatar Dec 05 '13 03:12 michelts

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

stevejalim avatar Dec 05 '13 09:12 stevejalim

Done ;)

michelts avatar Dec 05 '13 19:12 michelts

Hi Steve,

I updated this pull request to be compatible with django 1.7!

michelts avatar Dec 20 '14 10:12 michelts

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

stevejalim avatar Dec 22 '14 15:12 stevejalim