在Akamai Edge Server上刷新上传的图像,在同名的图像上使用相同的名称

StackOverflow https://stackoverflow.com/questions/5029881

  •  14-11-2019
  •  | 
  •  

我有一个应用程序,它在Akamai上传图像。有时,我们有必要以与以前以相同的名称上传图像。当我这样做时,Akamai就不会根据时间戳刷新边缘服务器上的图像。但是,如果我重命名图像并上载,我的更改将反映在所有边缘服务器上。

是否有任何ESI指令,我可以用来确保刷新图像。我知道这将击败使用CDN的目的,但我需要在所选内容上进行此功能。

任何帮助或方向都会很棒。

有帮助吗?

解决方案

I believe akamai supports If-Modified-Since/ETAGs which should get you what you want. Looking briefly at the documentation i found the following bullets which should help you.

// From Akamai Documenation //

Make sure that your origin server is sending information that indicates the version of the objects so that the Edge server can send a conditional GET request when those objects expire.

Also make sure that your origin server responds properly to these conditional requests, with a 304 Not Modified, if the file has not changed since the time specified or if the ETag value specified still matches.

Cache-Control and Expires headers instruct the browser on whether and how long to cache an object. But when refreshing an expired object, the browser must have information indicating the version of the object that it can send to the server in a conditional GET request.

Version-specific information commonly available to the browser may include (among others):

Last-Modified: If the browser receives a Last-Modified header with the object when caching it, the browser can then send an If-Modified-Since header when refreshing the object, requesting the server to send the object if it has changed since the date specified or respond with a 304 Not Modified response if it has not. Example, as received in the HTTP response: Last-Modified: Fri, 06 Feb 2009 00:08:43 GMT

ETag: An ETag is a unique string that identifies a specific version of the object. If the browser receives an ETag header with the object, it can send an If-None-Match header when refreshing the object, requesting that the server send the object if its current ETag does not match the ETag in the request or respond with a 304 Not Modified response if it does. Example, as received in the HTTP response: ETag: "4514b5-4824-4743e60ff96c0" Make sure that your site is sending information that indicates the version of the objects so that the browser can send a conditional GET request to the server when those objects expire.

其他提示

If an Akamai EdgeSever has the object in cache, it will serve the object without ever checking with origin. When you change the filename, the EdgeServer does not have the object in cache since it views this as a new object (the EdgeServers have a concept of a cache key, which is made up of the filename and some other things. The cache key is how the EdgeServer locates the object in cache).

If you change the object in place on your origin (e.g. you change the contents of the file, but do not change the filename), and an EdgeServer has the object in cache, it will serve it without checking the origin.

If you need to change files in place, you can use the purge mechanism via the Content Control Utility. Log into the web control panel and there is a GUI interface to purge files manually. Or you can use the SOAP API.

If you are constantly changing files and purging becomes an issue, you should look at updating your config. You can set up a low ttl (time to live) for your content, or you can set up a no-store for the content, which will force the EdgeServer to make an If-Modified-Since request back to your origin every time an object is request.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top