I'm trying to optimize page serving time on Google app engine, but I'm struggling at getting the effect I want.
in my app.yaml, I used the following directive:
handlers:
- url: /assets
static_dir: assets
expiration: 7d
under the asset folder, I have all my images, css and js. By using the 7d expiration, I would have expected the browser to use the local cached files and not come to my app for 7 days.
Although, in the response headers for my assets I get the following:
Cache-Control:public, max-age=604800
Cache-Control:no-cache, must-revalidate
I understand that with these headers, the browser will check on my app if the file as changed before releasing the cached version. (I can effectively see a bunch of 304 corresponding to my files under the asset folder, for both refresh and simple page load).
Is there a way in Google app engine to configure the cache behavior so the browser will not comeback for those files for 7d (on a simple page load), as specified in the expiration? (i.e. removing the "no-cache" from cache-control header)
P.S. I dont want to enable PageSpeed on my app. I want full control on the html served.
A cacheable response is an HTTP response that Cloud CDN can store and quickly retrieve, thus allowing for faster load times.
Dedicated memcache provides a fixed cache capacity assigned exclusively to your application. It's billed by the GB-hour of cache size and requires billing to be enabled.
To store data and files on App Engine, you can use Google Cloud services or any other storage service that is supported by your language and is accessible from your App Engine instance. Third-party databases can be hosted on another cloud provider, hosted on premises, or managed by a third-party vendor.
Are you logged on with an Admin-account by any chance? AppEngine adds some private headers about the costs for Admins and disables caching because that data is private. Logging out solved the problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With