1

I want to configure caching on a static website hosted on Azure Websites. My goal is to cache all static website resources: JS, CSS and JPG files but do NOT cache HTML pages. I thought about putting all my cacheable content into assets folder and cache only its contents, but is there are better approaches? Can I somehow use per-extension rules in my web.config file instead?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <location path="~/assets">
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
    </staticContent>
  </system.webServer>
  </location>
</configuration>
astaykov
  • 30,768
  • 3
  • 70
  • 86
Ivan Nikitin
  • 3,578
  • 27
  • 39
  • Azure Web Sites is just IIS. So everything that applies to IIS, applies there too. That's wy remove the Azure tag. – astaykov Jun 19 '15 at 13:23

0 Answers0