How to cache static contents to client with UseMaxAge?

Programming, error messages and sample code
If your site has many static contents, and large traffic, for better performance and for saving your hosting account resource, you can consider to cache static contents to client with UseMaxAge. Please copy the code below to your web.config file.

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

The cache time from the above code is one hour, you can change the cache time as your wish.