New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A way to flush the template cache / remove old files #158
Comments
There is no effective way to select all cache keys of django_compressor (although you could iterate over all keys and look for those that start with the default prefix Instead I would suggest to use Django's ability to handle multiple cache backends, as mentioned in the docs Simply set your EDIT: Getting to the backend is as easy as importing
|
Ah, another thing you can try is the |
Thanks for the suggestions. I think using a separate cache for this is the easiest solution for me. I have tried the mtime_cache management command, but as you said it doesn't clear the offline cache. |
certainly would be nice to not have to host a separate cache instance just for this. it seems quite common for compressor to get out of sync between cache and file system (i.e. if you delete the CACHE directory on disk, it will forever not work until you clear the cache). paying for a separate cache server or wiping the entire existing cache are't quite as good as a simple reset command for compressor |
Does anybody knows if there is a clear cache command at this moment? How to make django-compressor begin to compress files all over again, setting new keys into the cache, since the cache files were deleted? |
I don't know any such python or management command but if you use the python: shutil.rmtree(os.path.join(settings.STATIC_ROOT, 2015-11-19 13:04 GMT+01:00 Ivens Rocha notifications@github.com:
|
This one is old, but here are some notes:
|
I had several old cache files on disk that I wanted to clean up. The problem is that the templatetag_cachekey remembers the path of the old compressed .js.
Short of flushing all of my memcache keys, is there a way to flush just the compressor templatetag keys?
The text was updated successfully, but these errors were encountered: