Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine Python应用程序引擎中的静态\u文件与静态\u目录缓存过期标头_Google App Engine_Python 2.7_Cache Expiration - Fatal编程技术网

Google app engine Python应用程序引擎中的静态\u文件与静态\u目录缓存过期标头

Google app engine Python应用程序引擎中的静态\u文件与静态\u目录缓存过期标头,google-app-engine,python-2.7,cache-expiration,Google App Engine,Python 2.7,Cache Expiration,我正在使用GoogleAppEngine1.7.2/Python2.7,并试图添加静态文件的客户端缓存 在我的app.yaml中指定static_dir时,不会设置缓存控制头 - url: /static/images static_dir: static/images expiration: "7d 0h" 但是,当我将规范切换到静态_文件时,如下面所示,它确实得到了设置 - url: /static/images(.*) static_files: static/images/

我正在使用GoogleAppEngine1.7.2/Python2.7,并试图添加静态文件的客户端缓存

在我的app.yaml中指定static_dir时,不会设置缓存控制头

- url: /static/images
  static_dir: static/images
  expiration: "7d 0h"
但是,当我将规范切换到静态_文件时,如下面所示,它确实得到了设置

- url: /static/images(.*)
  static_files: static/images/\1
  upload: static/(.*)
  expiration: "7d 0h"
还有人看到了吗?我错过什么了吗?我的印象是,如果像上面那样编写,static_dir和static_文件是等价的


谢谢

我知道你的问题不久前就被问到了,但我在寻找类似问题时遇到了它,我想我会为了别人的利益而回答它

您已正确指定静态文件处理程序。 缓存问题可能是由于您在浏览器中以管理员身份登录(登录到appengine.google.com)。在不以管理员身份登录的情况下运行应用程序,应该会显示缓存按预期工作。这里有一个链接到