I am using Google App Engine (GAE) to serve an image from Google Cloud Storage (GCS) via the method CloudStorageTools::getImageServingUrl().
This returns an image URL like:
This image is not cached in the browser, as it does not return the proper expire/cache headers. I've tried setting the cache headers on the object in GCS:
Cache-control: public, max-age=1296000
...as well as the cache settings for the GAE configuration file app.yaml:
default_expiration: "4d 5h"
... which booth seem to have no impact on have the image is served. Is there any way to control the cache headers for images served through the URL coming from the CloudStorageTools::getImageServingUrl() method?
Thanks!
T
As mentioned in my comment, this is achievable with the "-e31" flag (in this case 31 days). In addition it can be achieved with a nginx reverse proxy setup (usefull if you need more control over the headers). My answer in the post Google App Engine getImageServingUrl with download file name shows an example.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments