unable to set cache expiration on in app.yaml for a python app

前端 未结 2 1261
孤独总比滥情好
孤独总比滥情好 2021-01-16 07:14

In my GAE app I am serving static content as follows (those are my entries in my app.yaml file):

handlers:
- url: /c         


        
相关标签:
2条回答
  • 2021-01-16 07:56

    After the hint from Martijn above I changed expiration values in my app.yaml to:

    handlers:
    
    - url: /css
    
      static_dir: static/css
    
      expiration: "0d 10m"
    
    
    
    - url: /js
    
      static_dir: static/js
    
      expiration: "0d 10m"
    

    Now everything works as expected and the I get the following headers in response:

    cache-control:public, max-age=600
    content-encoding:gzip
    

    Everything seems to work as expected now.

    0 讨论(0)
  • 2021-01-16 07:58

    GAE should work fine with 10m value. Most probably that was because you were signed in with your google admin account. GAE returns no-cache for such accounts. Trying opening the same page in an incognito returns proper cache expiry times.

    By default GAE sets cache to 10 minutes, so even if you didn't set any expiry - you should see 10 minutes instead of no-cache.

    0 讨论(0)
提交回复
热议问题