Reputation: 184
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.
Upvotes: 8
Views: 4763
Reputation: 5313
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.
Upvotes: 6
Reputation: 3197
How you load your page in the browser might be relevant here:
Upvotes: 0
Reputation: 4066
I didn't use the expiration directive and GAE sends the following as the default cache setting:
Cache-Control:public, max-age=600
Can you try removing expiration: 7d and see if GAE only sends 1 Cache-Control header?
Upvotes: 0