简体   繁体   English

app.yaml 问题 python 标准应用引擎

[英]app.yaml problem python standard app engine

I am trying to use the app.yaml in Python 3.8 for Google app engine standard.我正在尝试将 Python 3.8 中的 app.yaml 用于 Google 应用引擎标准。

My app.yaml looks like this;我的 app.yaml 看起来像这样;

handlers:
- url: /static
  static_dir: static
- url: /.*
  script: auto

I can then access all the files in the directory named "static".然后我可以访问名为“static”的目录中的所有文件。

If I then change app.yaml to;如果我然后将 app.yaml 更改为;

runtime: python38
handlers:
- url: /staticX
  static_dir: staticX
- url: /.*
  script: auto

If I then try to access any files in "staticX" I get a 404 error.如果我随后尝试访问“staticX”中的任何文件,我会收到 404 错误。 However I can still access the files in "static".但是我仍然可以访问“静态”文件。 Even a hard refresh gets a 200.即使是硬刷新也会得到 200。

Changing app.yaml has no effect.更改 app.yaml 无效。

This seems to be a matter of caching.这似乎是缓存的问题。 According to google documentation static handlers in Google App Engine is cached and, if you do not set value default_expiration , it will be still available in default 10 minutes.根据 google 文档static,Google App Engine 中的处理程序已缓存,如果您未设置值default_expiration ,它在默认 10 分钟内仍然可用。

I have done the same test on my side and indeed after redeployment static_dir are still available for around 10m.我在我这边做了同样的测试,确实在重新部署后static_dir仍然可用大约 10m。 I noticed that if I start to deploy and redeploy all over again, 10-20 times, sometimes the time seems to be longer than 10m.我注意到,如果我重新开始部署和重新部署,10-20 次,有时时间似乎超过 10m。 However, finally, when I check after a few hours, all changes have been available.然而,最后,当我在几个小时后检查时,所有更改都可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM