Comments (5)
So, you're trying to implement a cache (based on django cache backend) only?
I never said the django.cache is enough for you to implement a proper key value store enough to cover the needs of the current implementation and infact I don't think its such a great idea to have only non-persistent cache.
Well we need to query the key value store at least once each time for each thumbnail, that should be alot faster than quering the storage backend, thats the whole idea. Do you have some other idea on how this should work? please elaborate in that case so that I could take it in consideration.
from sorl-thumbnail.
The point is that django has a cache system in place.
The thing is, I have the caching setup with memcache, which is used everywhere. So now with the new sorl thumbnail is have the choice between taking tons of database queries or get redis installed on production.
Django cache framework is an abstraction layer which makes it easy to use everywhere and then on time of deployment I can pick the backend I want to use.
It might be redis, it might be memcache and for local development I can use locmem.
You could extend the snippet a bit and specify a thumbnail specific timeout for the cache.set. Thus making the keys lasts longer.
Also, yes, cache is faster then the storage backend, but what if I don't care? Right now you force one way of doing it which is totally different from the previous version.
from sorl-thumbnail.
But the cached db key value store doesn't take a database hit after first query, its loaded into memcached after that (or whatever cache backend you are using). Why don't you want to use this?
i know that the _find_keys_raw method is a bit narrow and I realize that all "key value" stores might not be able to implement this. One approach around the problem would be to keep track of the different 'identities' and keys in special keys, but I rather not, in case this grows to a real problem I will have to figure out a "nicer" way to solve those problems on a more fundamental level. Anyway, as I said I don't think using the django.cache as a key value store is a valid enough use case since I don't think its a good idea.
from sorl-thumbnail.
Ah.. I totally missed it cached because the cache_backend was set to dummy.
My bad :D
from sorl-thumbnail.
Finally if you don't want to use a Key Value Store at all, then just make your own Backend subclass that just looks at the storage or something, that should be an easy job. I am not forcing you to do anything, infact I'd go as far as saying the new design is very modular.
from sorl-thumbnail.
Related Issues (20)
- Feature request: face detection or PPOI HOT 3
- Automatic tests are not run with Django 4.0 & 4.1 HOT 1
- link on sorl-thumbnail/AUTHORS should be clickable
- Setting storage class does not support deconstructors
- Django 4.1 template tag 'thumbnail' conflict with easy-thumbnails HOT 1
- "Schematic view of how things are done" link in the documentation is dead HOT 1
- Support Django 4.2 - settings.DEFAULT_FILE_STORAGE is deprecated HOT 5
- Should an empty thumbnail template tag raise an exception?
- Delete old thumbnails from the media/cache directory and the database HOT 5
- image doesn't upload at resize_image field given path.
- DeprecationWarning from setuptools 67.5.0 and above HOT 9
- Make THUMBNAIL_STORAGE contain a storage key
- Release new version to support Django 4.2 HOT 14
- Master tests fail HOT 2
- Cache using FileSystemStorage storage engine and not the S3Boto3Storage one defined HOT 1
- Review and accept or reject pending pull requests HOT 2
- AWS S3 with sorl-thumbnail is super slow HOT 9
- How to create a thumbnail in a view, rather than dynamically via a template?
- Broken link in the docs
- django 4.2 - storage options (problem with s3 and template tag)
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 sorl-thumbnail.