Background: Recently, we implemented CDN and as part of that version is added to the query string to bust the cache. After that, we started noticing an issue where a web page is loading a random image instead of the correct image.

For suppose a div display is intended to display a.png but instead b.png is rendered on the page.

Expected: https://domain/a.png?la=en&vs=1&hash=5EE49654CAEA8782A2BD73BCE3FC23A038CAWL to load a.png on the browser
Actual: https://domain/a.png?la=en&vs=1&hash=5EE49654CAEA8782A2BD73BCE3FC23A038CAWL loads b.png on the browser


After doing some investigation on how a media renders from the cache, I found that during the GetStream of any media request, Sitecore checks to see if the item is present in the cache but couldn't really follow how a media request is served from the cache i.e. how the name of the file is mapped to the Guid in the media cache.

This information might lead us to find the root cause of the problem. Any information is appreciated.

  • If you have implemented a CDN and query string for cache busting, then it means the query string will bust the cache on CDN , not on Sitecore. Please provide more details on whether the CDN domain is a top level domain to cache all requests based on path pattern
    – Abhay Dhar
    Oct 24 '19 at 6:03
  • @AbhayDhar Thanks for taking time to reply, the CDN functionality was very recently implemented but we started seeing this as soon as the changes were done in the system in preparation to CDN.
    – Abhi
    Oct 24 '19 at 14:42
  • Does this not occur if the image cache is turned off?
    – Jeroen
    Oct 24 '19 at 15:00
  • @Jeroen I haven't tried this yet, even If I do that I don't know a reproducible step to check if the issue is resolved. Currently, CDN is in place technically we can remove the cache but the CDN is not fully implemented for all the sites, is there a way to limit the cache to certain sites?
    – Abhi
    Oct 24 '19 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.