Bob Chesley

Bob Chesley's Blog

Cache busting in Akamai (any CDN)

Bob Chesley,softwareangularcaching

Cache busting with CDNs like Akamai

It is possible to configure Akamai (or any CDN) to use cache busting query parameters for specific files, including JS files. Akamai's Property Manager allows you to define behaviors and rules for different types of content.

Here's a general guide on how you might configure this:

  1. Identify JS Files:

    • In your Property Manager settings, identify the behavior or rule related to JS files. This could be a rule that matches URLs ending in ".js" or any other criterion that suits your setup.
  2. Modify Cache Key for JS Files:

    • Within the JS-specific behavior or rule, modify the Cache Key settings to include the query parameter for cache busting.
  3. Add the Query Parameter for JS Files:

    • Specify the query parameter (e.g., ?v=<version_number>) within the Cache Key settings for JS files.
  4. Test the Configuration:

    • Save your changes and test the configuration to ensure that the cache busting query parameter is being appended only to the URLs of JS files.

Here's a simplified example:

Behavior: Cache for JS Files
  - Cache Key
    - Include Query Parameters: Yes
    - Add Query Parameter: v

After making these changes, only JS files matching the criteria you've set in your Property Manager rules will have the cache busting query parameter appended to their URLs.

This level of granularity allows you to apply cache busting to specific file types or paths, ensuring that you have control over which resources benefit from cache busting and which ones do not.