Giter Site home page Giter Site logo

Comments (7)

niwinz avatar niwinz commented on June 21, 2024

Making this change is dangerous, because, previously, the permanent cache is done by setting timeout to 0 and a new version just do the opposite behavior. All behavior that are now supported on django 1.6, are already supported much earlier in django-redis.

I don't know the good way to change this mantaining backward compatibility.

from django-redis.

rmmr avatar rmmr commented on June 21, 2024

I think it's quite simple. Check the django version and use a settings.py entry. For 1.6 and up switch to the behaviour as documented in django 1.6. This means timeout = 0 will not cache indefinitely for django 1.6 users. If by any chance 1.6 users will want to keep the old behaviour, they can change the settings.py entry.

It's dangerous not to make any change, because 1.6 users who want to switch from django's default caching backends to yours can run into trouble.

I'll work this out in my fork anyways. Cheers!

from django-redis.

niwinz avatar niwinz commented on June 21, 2024

Great! Thanks!

from django-redis.

rmmr avatar rmmr commented on June 21, 2024

Allright, made an initial attempt to fix this. Changes can be found in client/default.py at lines 32 and 140 - 145. Changes should be self-explanatory.

from django-redis.

niwinz avatar niwinz commented on June 21, 2024

Sorry, but I don't have much time this week for it. This weekend this should be merged and fixed!

from django-redis.

niwinz avatar niwinz commented on June 21, 2024

Now partially merged with minor changes: 09939dc

Backward compatibility changes are not necessary, because 0 immediate timeout is only for memcached backend and django-redis can continue with own behavior :D

Thanks for your efforts!

from django-redis.

rmmr avatar rmmr commented on June 21, 2024

Thank you too! Even better :) who needs immediate timeouts anyway.

from django-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.