My script works fine: http://keakon.appspot.com/image/agZrZWFrb25yDAsSBUltYWdlGOUSDA.jpeg
self.response.headers['Content-Type'] = 'image/' + image.type self.response.headers['Last-Modified'] = image.time and image.time.strftime(GMT_FORMAT) or DEFAULT_LAST self.response.headers['Expires'] = EXPIRES self.response.headers['Cache-Control'] = 'public, max-age=315360000' self.response.headers['Date'] = DATE self.response.out.write(image.content) 2009/12/7 Pranny <[email protected]>: > Per my experience, the production server also behaves the same > > On Dec 7, 5:43 pm, 风笑雪 <[email protected]> wrote: >> You need test it on production sever, the develop server always sends >> no cache header. >> >> 2009/12/7 Pranny <[email protected]>: >> >> > One issue that i have faced while serving dynamic images is that >> > images are not cached by default. So, every page reload or so, takes >> > burden in fetching images. >> > I tried to explicitly cache the images by setting headers as >> >> > self.response.headers['Content-Type'] = "image/png" >> > self.response.headers['Cache-Control'] = "public, max-age=600" >> > self.response.headers['Expires'] = "Thu, 15 Apr 2011 20:00:00 GMT" >> > self.response.out.write(serve) >> >> > Here serve is the blob object that contains image. But this also seems >> > not to be working. >> >> > Is this related somehow to the request header which goes on as >> >> > Cache-Control max-age=0 >> >> > How can i fix this. My application is supposed to be using a lot of >> > images and its design is such that all images are served dynamically (/ >> > img?id=XYZ). >> >> > -- >> >> > 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 >> > athttp://groups.google.com/group/google-appengine?hl=en. > > -- > > 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. > > > -- 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.
