Robert
Robert

Reputation: 515

Client side caching of images resized by ImageResizer

I've done a fair amount of searching, but I really cannot find a straight answer to this: How do you make client side caching of images resized by ImageResizer to work, i.e. url's on the format http://<server>/image.jpg?maxwidth=50?

Using the following setting in web.config seems to make IIS setup output caching for all static files, except the resized images:

<staticContent>
  <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>

Upvotes: 0

Views: 1059

Answers (1)

Lilith River
Lilith River

Reputation: 16468

There are several ways to do this at the web server (or application) level, but ImageResizer offers a simple way to do it with the ClientCache plugin, which is installed by default.

To configure via Web.Config, set the clientcache minutes value to the expiry duration you prefer. In the following example we use 24 hours.

<resizer> <clientcache minutes="1440" /> </resizer>

Upvotes: 3

Related Questions