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>
1
  • Azure Web Sites is just IIS. So everything that applies to IIS, applies there too. That's wy remove the Azure tag. Commented Jun 19, 2015 at 13:23

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.