Google App Engine: URL from CloudStorageTools::getImageServingUrl not cached

tromtv

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:

https://lh3.googleusercontent.com/KE4x0Ptk8GbqkCqEcdBVkLF0ZpQceXGL1oL6C5be5zHSqpEGI_pceev1SjOFTHh1kj7zbzwHcFfFgh_6gSIA=s1600

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

tromtv

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Issue with Google Cloud Storage resumable upload URL from App Engine

From Dev

Uploading file from external URL on Google App Engine with Python

From Dev

Cakephp: How to retrieve video url from Google App Engine

From Dev

URL Size in Google App Engine

From Dev

Google App Engine version URL and app Versioning

From Dev

google apps from app engine

From Dev

How do you remove the app id from the url on google app engine?

From Dev

hide app from public in Google App Engine

From Dev

Public URL to files in Google Cloud Storage from python backend (Google App Engine)

From Dev

Google App Engine - Busting Serving URL Cache

From Dev

Fetching url in python with google app engine

From Dev

How to enable url rewriting in Google App Engine

From Dev

Use of urllib2 in Google App Engine throws "Deadline exceeded while waiting for HTTP response from URL:..."

From Dev

how to hide .html extension in URL from google app engine (cloud hosting)

From Dev

Setup SSL from COMODO for Google App Engine

From Dev

Flickr OAuth from Google App Engine Python

From Dev

Fetching an image from google app engine ndb

From Dev

Code push from GitHub to Google App Engine

From Dev

Migrating from Google App Engine ecosystem

From Dev

Access Xero from Google App Engine

From Dev

Connecting to Firebase from Python Google App Engine

From Dev

Upload File from App Engine to Google Drive

From Dev

Inconsistent Fetch From Google App Engine Datastore

From Dev

Call Firebase database from Google App Engine

From Dev

Access Xero from Google App Engine

From Dev

Google App Engine: Counting entries from the datastore

From Dev

Google App Engine request FROM a country

From Dev

Migrating from Google App Engine ecosystem

From Dev

Google App Engine - Get from repeated StructuredProperty

Related Related

  1. 1

    Issue with Google Cloud Storage resumable upload URL from App Engine

  2. 2

    Uploading file from external URL on Google App Engine with Python

  3. 3

    Cakephp: How to retrieve video url from Google App Engine

  4. 4

    URL Size in Google App Engine

  5. 5

    Google App Engine version URL and app Versioning

  6. 6

    google apps from app engine

  7. 7

    How do you remove the app id from the url on google app engine?

  8. 8

    hide app from public in Google App Engine

  9. 9

    Public URL to files in Google Cloud Storage from python backend (Google App Engine)

  10. 10

    Google App Engine - Busting Serving URL Cache

  11. 11

    Fetching url in python with google app engine

  12. 12

    How to enable url rewriting in Google App Engine

  13. 13

    Use of urllib2 in Google App Engine throws "Deadline exceeded while waiting for HTTP response from URL:..."

  14. 14

    how to hide .html extension in URL from google app engine (cloud hosting)

  15. 15

    Setup SSL from COMODO for Google App Engine

  16. 16

    Flickr OAuth from Google App Engine Python

  17. 17

    Fetching an image from google app engine ndb

  18. 18

    Code push from GitHub to Google App Engine

  19. 19

    Migrating from Google App Engine ecosystem

  20. 20

    Access Xero from Google App Engine

  21. 21

    Connecting to Firebase from Python Google App Engine

  22. 22

    Upload File from App Engine to Google Drive

  23. 23

    Inconsistent Fetch From Google App Engine Datastore

  24. 24

    Call Firebase database from Google App Engine

  25. 25

    Access Xero from Google App Engine

  26. 26

    Google App Engine: Counting entries from the datastore

  27. 27

    Google App Engine request FROM a country

  28. 28

    Migrating from Google App Engine ecosystem

  29. 29

    Google App Engine - Get from repeated StructuredProperty

HotTag

Archive