Skip to Main Content
Product Suggestions
Created by Andrew Ardron
Created on May 15, 2018

Implement CDN for customer sites (part 1 - manual setup)

This sounds complex, but it really isnt. I got a mock-up working in ten minutes! E.g. this downloads from the CDN in 24ms (including the full round trip) https://acatest.azureedge.net/streamProductImage.aspx?width=400&height=400&paddingColour=ffffff&ref=FR3503&ver=1 

Setting up the actual CDN in azure is astonishingly easy. Even adding a custom domain is easy (adding them manually is easy).

We can setup and test CDN's on some customer sites, if we just make sure that any truly dynamic content is not cached, or if it is user-specific is cached with private cache headers. I..e the only risk i can see with my CDN testing is if things like product categories AJAX data, or dynamically generated HTML pages were to be cached. Just so long as these have been definitely set to no-cache, then we can use a CDN pretty reliably.

NOTE: because we use query strings (especially in product image URL's) we need to set the correct option to make each query string unique in the cache - or otherwise you get the same image each time! see https://docs.microsoft.com/en-us/azure/cdn/cdn-query-string - and setting this means we need to be careful with query strings (and not include things like sessionid or other things that constantly change -otherwise each request is unique and nothing is cached.

For Part 2 - see https://prospectsoft.aha.io/ideas/ideas/SPA-I-147 

  • Attach files