清除appEngine Flex静态文件缓存 [英] Clear appEngine Flex static files cache

查看:103
本文介绍了清除appEngine Flex静态文件缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上设置了1年的缓存控件。
如何对AppEngine说清除!从服务器上获取新版本?

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 ?

配置为Flex自定义环境

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


推荐答案

假设您的应用是一个提供统计信息ic文件,则服务器发送的缓存参数由您的应用程序代码控制。这意味着一旦部署了具有更新参数的新版本,服务器就会发送更新后的值。

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.

这篇关于清除appEngine Flex静态文件缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆