Comments (4)
As workaround, if you want store raw strings, you can use redis_cache.get_redis_connection(alias)
for obtain a raw redis client and use it for store raw strings without serializing.
Also, you can subclass the default client, and overwrite pickle and unpickle methods with own behavior (WARNING: in future release these methods will change to serialize/deserialize ;))
from django-redis.
Hi @askaliuk
I have used pickle for serialize everything for conserve the real type for everything (django-redis-cache was some bugs related to serialize string, but deserializes integer...)
Now, django-redis deals with integer values as special values and stores it without pickling, allowing
redis atomic operations over it. And... now if I enable string storage without pickling, the previous strange and inconsistent behavior will return (when I set("foo", "1"), get("foo") will return 1 (int))
For more information: https://github.com/niwibe/django-redis/blob/master/redis_cache/client/default.py#L281
If you know any better approach for it, maintaining atomic operations for integers, improvements are welcome.
from django-redis.
Thank you @niwibe for explanation.
I don't have good ideas for now, so feel free to close this issue.
from django-redis.
Thanks to you for your interest! ;)
from django-redis.
Related Issues (20)
- Cache is saved as disk cache in the browser HOT 3
- Automatic upgrade to redis-py version 5.0 causes ImportError if HiredisParser enable HOT 7
- Redis Sentinel breaking change in redis==5.0.0
- object attribute is missing after manager.py is restarted when using django redis cache HOT 1
- Why do we use `param["url"]` as a unique connection pool key? HOT 5
- Connection Pooling doesn't work as intended HOT 1
- Pytest 7.0 compatibility HOT 1
- Drop django 4.0
- Drop support for django 3.2 HOT 1
- How to configure and connect redis cluster correctly? HOT 2
- Django `TIMEOUT` setting not working as expected HOT 2
- Which timezone wil it take? system timezone or django timezone HOT 1
- Why Django Redis does not raise exception while connecting to Redis Server with SSL param equal string "False"
- `Expire` method fails when using `DEFAULT_TIMEOUT` HOT 1
- Getting/Setting occasionally extremely slow HOT 5
- django requirements update
- Add NX, XX, GT and LT to expire and pexpire HOT 2
- Multiple redis caches with fallback mechanism HOT 1
- Is it necessary to get coverage of tests directory? HOT 2
- Implementing HGET
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-redis.