Hello I want to put "One Year" of cache on all files, except ìndex.html that I want Cache-Control: no-cache
But I get :
I expect the last line to override the default_expiration but i get :
cache-control: no-cache
cache-control: public, max-age=31536000
my app.yaml
runtime: nodejs12
default_expiration: '365d'
env_variables:
environment: '--prod'
handlers:
- url: /
static_files: myproject/index.html
upload: myproject/index.html
http_headers:
Cache-Control: no-cache
On the index.html.... both at the same time do you have an idea how to have only the first header ?
This is actually an expected behavior at the moment.
1) If you set default_expiration: 0 and Cache-Control: no-cache is set in the http_headers of the handlers then the following headers will be set:
cache-control: no-cache, must-revalidate expires: Fri, 01 Jan 1990 00:00:00 GMT
2) If default_expiration is the default (10m), or a particular value is set as in your Case, '365d' and you override expiration on per-handler basis, then handlers with expiration: 0 will be served also with 10m or the value set caching. So, the output you got is actually the expected output at the moment.
I agree that 2) may be unexpected and this same concern has been raised with the App Engine team on this thread and on this issue link. It is not considered a bug at the moment, but an internal feature request was submitted to the App Engine team for necessary modifications. I suggest you bookmark the issue link for updates on the fixes as there is no ETA for the implementation at this time.