title: How can I have Google App Engine clear memcache every time a site is deployed?
body: <p>The title asks it all. The content on the site I'm building wont change very quickly at all and so Memcache could potentially store data for months except for when I put up an update. Is there a way to make it clear the cache every time I deploy the site? I'm using the Python runtime.</p>
  
  <h3>Update 1</h3>
  
  <p><del>Using <a href="https://stackoverflow.com/users/171461/jldupont">jldupont</a>'s <a href="https://stackoverflow.com/questions/1983556/how-can-i-have-google-app-engine-clear-memcache-every-time-a-site-is-deployed/1983573#1983573">answer</a> I put the following code in my main request handling script...</del></p>
  
  <h3>Update 2</h3>
  
  <p>I've switched to the method mentioned by <a href="https://stackoverflow.com/users/56495/koen-bok">Koen Bok</a> in the selected answer's comments and prefixed all my memcache keys with <code>os.environ['CURRENT_VERSION_ID']/</code> with the helpful code in the <a href="https://stackoverflow.com/questions/1983556/how-can-i-have-google-app-engine-clear-memcache-every-time-a-site-is-deployed/1983573#1983573">answer</a>'s 2nd update. This solution seems to be much more elegant than the function I posted before.</p>