app.yaml: Set Cache-Control header to private for CSS

Google App Engine agressively caches stuff. They are currently serving
a 24-hour old version of my CSS after multiple updates and re-deploys.
Ughhh. From their docs:

> After a file is transmitted with a given expiration time, there is
> generally no way to clear it out of web-proxy caches, even if the user
> clears their own browser cache. Re-deploying a new version of the app
> will not reset any caches. Therefore, if you ever plan to modify a
> static file, it should have a short (less than one hour) expiration
> time. In most cases, the default 10-minute expiration time is
> appropriate.

The only way to break this for now is to change the CSS *directory*.
In the future I think we have to be sure to set the private cache
control header, which lets browsers cache it, but not public CDNs.

See: https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled
This commit is contained in:
Alan Orth 2021-03-14 11:58:57 +02:00
parent bd31ac912e
commit aabb783d99
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -4,3 +4,5 @@ entrypoint: gunicorn -b :$PORT main:app
handlers: handlers:
- url: /static/css - url: /static/css
static_dir: static/css static_dir: static/css
http_headers:
Cache-Control: private