Clear appEngine Flex static files cache

隐身守侯 提交于 2019-12-11 02:53:54

问题


I set a cache-control on my server of 1 year. How to say to the AppEngine "clear !" to take a new version from the server ?

The configuration is Flex custom environment

runtime: custom
env: flex

env_variables:
    writecontrolEnv: 'prod'

handlers:
- url: /.*
  script: this field is required, but ignored

service: gateway-prod

automatic_scaling:
  min_num_instances: 1
  max_num_instances: 2

resources:
  cpu: 1
  memory_gb: 2
  disk_size_gb: 10

skip_files:
- node_modules/

network:
  instance_tag: gateway

回答1:


Assuming that your app is the one serving the static files then the cache parameters sent by the server are controlled by your application code. Which means that once you deploy a new version with updates parameters the server will send the updated values.

But the problem is that caching is actually performed by the client (or some middle-man network device), so the end user will not reach to the server until the (very long in your case) cache expiration time is reached, so it won't see the update until then.

You can try to clear your browser cache, hoping that the browser was the one doing the cache-ing.

To prevent such occurrences in the future you may want to choose a shorter cache expiration time or use some cache busting technique like this one.



来源:https://stackoverflow.com/questions/53780956/clear-appengine-flex-static-files-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!