Send a “304 Not Modified” for images stored in the datastore

前端 未结 4 2130
迷失自我
迷失自我 2021-02-04 20:43

I store user-uploaded images in the Google App Engine datastore as db.Blob, as proposed in the docs. I then serve those images on /images/.jpg

4条回答
  •  我寻月下人不归
    2021-02-04 20:56

    why would the code use this:

     self.response.headers['ETag'] = '"%s"' % (content.etag,)
    

    instead of this:

     self.response.headers['ETag'] = '"%s"' % content.etag
    

    I think it is the same and will use the 2nd unless someone explains the reasoning.

提交回复
热议问题