Commits

Ivan Melnikov committed b8d65f1 Draft

Clear page cache while page move/delete

Comments (0)

Files changed (1)

 		page.delete()
 		index.delete()
 
+		memcache.delete(CACHE_PAGE+path)
+
+		# TODO: Delete files?
+
 		self.redirect('/')
 
 
 		index.path = index_path(new_path)
 		index.put()
 
+		# clear page cache
+		memcache.delete(CACHE_PAGE+path)
+
 		# move whole cluster
 		if self.request.get('cluster'):
 			taskqueue.add(url=URL_MOVE_PAGE, params={'from': path, 'to': new_path})
 				page_id = index.key().id()
 				page = Page.get_by_id(page_id)
 
+				# clear page cache
+				memcache.delete(CACHE_PAGE+page.path)
+
+				# update path
 				relative = page.path[len(from_path):]
-				log.info('relative '+relative)
 				path = to_path + relative
 				page.path = path 
 				index.path = index_path(path)