0

My job uses Akamai as a CDN for its marketing website. Often times there would be changes to css or js files that are cached on the CDN when accessing the site over the domain.

We're running into issues where updated versions of these files are not served over the CDN even when version strings are used.

For example,

/js/scripts.min.js?201801041618

would still serve the old version of this file after an update when attempting to access over the CDN (the domain).

When accessing the site via the direct endpoint (where the domain points) the latest version of the file is loaded.

One option is to clear the file from Akamai manually, but this is cumbersome and not scalable.

We are using a Symfony 4 PHP 7.2 - other than version strings, is there some server-side solution to indicate that a particular file must be served from it's source, rather than from cache?

yevg
  • 1,846
  • 9
  • 34
  • 70
  • I can't speak for Akamai, but AWS CloudFront only considers/forwards the query string if you explicitly configure it to. I suspect this is happening to you on Akamai. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html – ceejayoz Jan 04 '19 at 21:26
  • 2
    https://developer.akamai.com/blog/2017/04/14/what-you-need-know-about-caching-part-3 "Next, let’s take a look at how query parameters might affect your cache key. If your URLs use query parameters you have the option to include or exclude them in your cache key." – ceejayoz Jan 04 '19 at 21:27
  • I do not manage our Akamai account but will check with host engineering on this - thank you! – yevg Jan 04 '19 at 21:40
  • If you change a static file's contents, change the file's name. Everything else is a kludge and/or bad practice. – Sammitch Jan 04 '19 at 22:20

0 Answers0