【发布时间】:2014-06-10 23:15:43
【问题描述】:
在我的 GAE 应用程序中,我提供如下静态内容(这些是我在 app.yaml 文件中的条目):
handlers:
- url: /css
static_dir: static/css
expiration: "10m"
- url: /js
static_dir: static/js
expiration: "10m"
尽管此处提供了信息:https://developers.google.com/appengine/docs/python/config/appconfig#expiration 无论我使用开发服务器还是上传我的应用程序,内容都不会缓存在浏览器中。
我正在使用 Chrome,请求标头是:
cache-control:max-age=0
响应头是:
cache-control:no-cache, must-revalidate
pragma:no-cache
server:Google Frontend
status:304 Not Modified
根据我能找到的一些答案,我在登录和退出我的谷歌管理员帐户时都对此进行了测试,没有任何变化。
对此的任何帮助将不胜感激。非常感谢!
我在退出管理员帐户时收到的响应标头:
date:Fri, 25 Apr 2014 09:54:44 GMT
etag:"lhoIow"
server:Google Frontend
status:304 Not Modified
version:HTTP/1.1
【问题讨论】:
-
对于当前 GAE 项目中使用
default_expiration: "30d"的静态内容,我同时看到了Cache-Control: public, max-age=2592000和Expires: Sun, 25 May 2014 09:54:57 GMT(例如,距“现在”30 天)。某些东西无法获取您的app.yaml文件。 -
非常感谢Martijn!您的提示为我指明了正确的方向,似乎我设法解决了这个问题。非常感谢!
标签: python google-app-engine caching