Akamai Cache refresh
Asked Answered
R

4

11

How often does Akamai refresh cache?

We use Akamai to cache frequently accessed files. When uploading and overwriting files to the Akamai FTP, I can't see the new file reflected live.

Anybody have any experience with this?

Rexanne answered 9/12, 2008 at 1:20 Comment(0)
D
11

It is configurable. You will need to talk to whoever in your organisation manages your Akamai account. They will have access to change how and what things are cached. If necessary, they can put you in touch with a technical contact at Akamai.

Denotative answered 9/12, 2008 at 1:38 Comment(0)
H
14

Bear in mind that the files may be cached elsewhere as well, including at any proxy servers that the client is behind or in the browser's cache itself. An easy way to get around this is to add a query string to the URL, and change the value each time you update the files, or set it to a random value to bypass the cache each time. The server will ignore the query string, but the browser and proxies will think it is a completely different URL and re-request it.

For instance, instead of requesting:

styles.css

request:

styles.css?version=1

Hitherto answered 9/12, 2008 at 1:40 Comment(2)
I know this is a really old thread, but does this work for akamai? Meaning, will akamai pull a new version of the file from your origin by just changing the query string?Astylar
It works for Akamai, but you have to configure it to take into account query parameters. I'm not sure what the default is.Scupper
D
11

It is configurable. You will need to talk to whoever in your organisation manages your Akamai account. They will have access to change how and what things are cached. If necessary, they can put you in touch with a technical contact at Akamai.

Denotative answered 9/12, 2008 at 1:38 Comment(0)
C
1

Another thing to check is the time to live set for items Akamai caches.

I use Akamai at work, recently found that it will cache indefinitely anything with a max-age of zero. Then when I'd corrected that to something more useful, it randomly returned old and new items from the same url. You could see in the header content that the old items, in this case PDF files, still had a max age of zero, where as the current PDFs had the new max age value.

To remedy this we had to clear the urls from Akamai so that it cached new versions of the PDFs, using the corrected max age value. Now the effected PDFs only stay cached for the new max age time, and we consistently receive the correct versions.

Chole answered 28/2, 2012 at 18:44 Comment(0)
M
0

Files on the Akamai network can be tuned with whatever cache configuration the end customer requires. Typically the two most common approaches to cache design I see are:

  1. Configuring based on file extension. (e.g. *.css, *.js, etc)
  2. Configuring based on path. (/product/test /checkout, etc)

If you enable the following pragma headers to your request then you can inspect the HTTP response headers and determine the cache length of the file - it's included in the cache key.

Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-extracted-values, akamai-x-get-ssl-client-session-id, akamai-x-get-true-cache-key, akamai-x-serial-no, akamai-x-get-request-id,akamai-x-get-nonces,akamai-x-get-client-ip,akamai-x-feo-trace

e.g the following indicates a file cached for 4 days:

x-cache-key:S/L/3568/82745/4d/mirror-somedomain.akadns.net/contentimages/meganav/020118/2018-02-01-someimg.jpg cid=_site_locale=us&site_language=en_

Meddlesome answered 22/2, 2018 at 8:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.