Afshin Mehrabani
Afshin Mehrabani

Reputation: 34987

Managing Images and media files in MVC4

I've used bundling in MVC4 for managing css and js files but I didn't find a good solution for managing/caching images and media files in MVC4.

Should I run another static file server for that?

Upvotes: 0

Views: 528

Answers (1)

Albin Sunnanbo
Albin Sunnanbo

Reputation: 47068

You could configure IIS cache headers for the static content via web.config and the staticContent/clientCache element.

Something like

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="01:00:00" />
    </staticContent>
  </system.webServer>
</configuration>

For a one hour cache policy.

Upvotes: 1

Related Questions