app-engine-patch

Images caching in browser - app-engine-patch application

前提是你 提交于 2019-12-21 05:13:21
问题 I have a little problem with caching the images in the browser for my app-engine application I`m sending last-modified, expires and cache-control headers but image is loaded from the server every time. Here is the header part of the code: response['Content-Type'] = 'image/jpg' response['Last-Modified'] = current_time.strftime('%a, %d %b %Y %H:%M:%S GMT') response['Expires'] = current_time + timedelta(days=30) response['Cache-Control'] = 'public, max-age=2592000' 回答1: Here is an example code

Images caching in browser - app-engine-patch application

試著忘記壹切 提交于 2019-12-03 17:04:54
I have a little problem with caching the images in the browser for my app-engine application I`m sending last-modified, expires and cache-control headers but image is loaded from the server every time. Here is the header part of the code: response['Content-Type'] = 'image/jpg' response['Last-Modified'] = current_time.strftime('%a, %d %b %Y %H:%M:%S GMT') response['Expires'] = current_time + timedelta(days=30) response['Cache-Control'] = 'public, max-age=2592000' Here is an example code for my fix copy in dpaste here def view_image(request, key): data = memcache.get(key) if data is not None: if