memcache and wildcards

No, there isn’t a direct easy way to do this. The FAQ addresses this, and provides a kind of workaround: Deleting by Namespace While memcached does not support any type of wildcard deleting or deletion by namespace (since there are not namespaces), there are some tricks that can be used to simulate this. They do … Read more

Clear Memcached on Heroku Deploy

I deploy my applications using a bash script that automates GitHub & Heroku push, database migration, application maintenance mode activation and cache clearing action. In this script, the command to clear the cache is : heroku run –app YOUR_APP_NAME rails runner -e production Rails.cache.clear This works with Celadon Cedar with the Heroku Toolbelt package. I … Read more

best place to clear cache when restarting django server

It’s bad practice to put code in settings.py other than assignments. It’s better suited as a management command: from django.core.management.base import BaseCommand from django.core.cache import cache class Command(BaseCommand): def handle(self, *args, **kwargs): cache.clear() self.stdout.write(‘Cleared cache\n’) Which you can add to your project by sticking it in someapp/management/commands. For instance you could create a new app … Read more

tech