I have a slight problem caching images in the browser for my app-engine application. I-Meem is finally modified, Ends and images are loaded every time on the cache-control header. Here is the top part of the code: <[content-type '] =' picture / jpg '
feedback [' last-modified '] = current_ time.strftime (responses [ 'Cache-control'] = 'public, maximum-age = 2592000'
[ ] Here is a Deep View_image (request, key): data = memcache.get (key) if there is no data, then none: if (request. META.get ('HTTP_IF_MODIFIED_SINCE')
') & Gt; = data [' Inner M-Modified ']): Data. Status_code = 304 Back to Other Data: image_content_blob = # To get the data code from the data store current_time = datetime.utcnow () response = HttpResponse () last_modified [' content-type '] = 'Image / JPG' response ['Last-modified'] = Last_modified.startfight ('% A,% D% B% Y% H:% M:% s GMT') ['termination'] = ['cache- Control '] =' public, max-age = 315360000 'response [' date '] = current_time response content = image_us Int_blob memcache.add (image_key, reaction, 86400) returns response
Comments
Post a Comment