You could use the namespace attribute of memcache.add/set/etc.
In a global settings/config file, set the namespace to be your
released version number and then adjust all of your memcache calls to
use this namespace.
On a new release, the existing items will remain, but they will fall
out over time (and your application won't see them because it's on a
different namespace).
This doesn't play nice with the Multi-tenancy API, so if you need to
use that, you'd have to instead adjust your cache keys to be prefixed
with your released version id.
E.g., in Python:
settings.py
RELEASED_VERSION = 'V1' # your build/deployment script would update
this
--
some_other_file.py
import settings
from google.appengine.api import memcache
def foo():
memcache.get('your-cache-key', namespace=settings.RELEASED_VERSIOIN)
# (or)
def bar():
cache_key = 'your-cache-key'
memcache.get('%s:%s' % (settings.RELEASED_VERSION, cache_key))
j
On Nov 1, 12:05 pm, pdknsk <[email protected]> wrote:
> I'd like to automatically reset memcache immediately when I've
> uploaded a new version. Is this possible? I currently have a /reset
> script which I run manually every time. It's a bit tedious and I'd
> like to automate it, especially since there can be a delay of up to a
> minute between a deployment success message and the updated version
> actually being available. Thanks!
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.