0
votes

I am trying to use the app.yaml in Python 3.8 for Google app engine standard.

My app.yaml looks like this;

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

I can then access all the files in the directory named "static".

If I then change app.yaml to;

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. However I can still access the files in "static". Even a hard refresh gets a 200.

Changing app.yaml has no effect.

1
Try a different browser and see if the same result happens. Do you have files in staticX?John Hanley
Tried a different browser, same problem. the 200 and 404 codes are logged. This problem is on a local windows machine. If I edit the main.py file, I get "Detected change ... reloading" , no such message appears when I edit app.yamlShane Best
what do you mean by "changing app.yaml"? are you redeploying the app successfully?vitooh
All this is on the development server. If I deploy (to appspot) the second app.yaml (staticX), I can access both directories static and staticX. This is weirdShane Best
What's your scaling type? Do you use traffic splitting? Do you have cache management/CDN?guillaume blaquiere

1 Answers

0
votes

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.

I have done the same test on my side and indeed after redeployment static_dir are still available for around 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. However, finally, when I check after a few hours, all changes have been available.