locked
No browser caching and slow speeds on Akamai CDN RRS feed

  • Question

  • I'm trying to diagnose issues with a brand new Azure CDN Akamai setup and usage. The CDN works fine, but having unexpected performance issues. They are:

    • No browser caching even though resources have response headers of "cache-control:public, max-age=31536000"
    • Long periods to TTFB and equally long download times for resources (i.e. slow download rates)

    We have compression enabled and 'Cache every unique URL' enabled from the Azure portal. The CDN endpoint is pointing to an Azure Web App and the resources themselves are js and css files generated by the ASP.NET bundler and have query strings for the version.

    As an aside, serving the files directly from the Web App is fast and caches the files fine which leads me to believe it is the CDN that is returning the resources incorrectly.

    Thanks in advance for any suggestions/insights.

    Thursday, October 20, 2016 7:15 AM

Answers

  • So with thanks to Richard Li and other investigations, we found it was due to a number of issues:

    <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    • Image resizer plugin setting needing added as clientCache 525600

    Tuesday, November 15, 2016 5:29 AM

All replies

  • Hey Damien,

    Could you send us your endpoint url so we may replicate the issue ourselves?

    Thursday, October 20, 2016 8:29 PM
  • Can I send it to you privately in some way so I'm not broadcasting the URL on this forum issue?
    Friday, October 21, 2016 6:46 AM
  • Yes, please send the endpoint and origin to rli@microsoft.com
    Friday, October 21, 2016 6:51 AM
  • Hey Damien,

    The issue is that the content is not cacheable due to a Vary:User-Agent header in the response from the origin. Once you remove that header, the content should cache and you will see the improved performance that comes with a CDN.

    Note that the Vary:Accept-Encoding header is fine, but any other Vary header value will prevent caching on Akamai.

    Monday, October 24, 2016 8:51 PM
  • So with thanks to Richard Li and other investigations, we found it was due to a number of issues:

    <clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
    • Image resizer plugin setting needing added as clientCache 525600

    Tuesday, November 15, 2016 5:29 AM