I set up Azure CDN for Azure app service, and all works fine except caching. I added the clientCache node as described here.
<clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge" />
And also set up bundles for the CDN.
The result is:
Cache works for jpeg, png.
Cache-Control:max-age=2592000
But for js and css files I get the following headers:
Cache-Control:no-cache
Expires:-1
Pragma:no-cache
Thanks for any help.
From my test, it looks like Azure already enables caching of js/css caching by default. I get
Cache-Control:max-age=2592000
if I simply use the<clientCache>
tag.Are you saying that you're getting
Cache-Control:no-cache
from the bundled scripts/css? You should just getCache-Control:public
on the bundles.I did notice that I would get
Cache-Control:no-cache
if I started playing with caching profiles. But that's a moot point because Azure enables js/css caching by default.