Add expire headers

Chetan Sharma asked on August 3, 2014 14:07

Hello All,

This is one aspect I have trouble setting in Kentico. How can I set "Expire Headers" to static components images. As all our website gets "F" grade on this aspect of Google PageSpeed and YSlow.

Any suggestions?

Regards Chetan

Recent Answers


Kamran Ansari answered on August 8, 2014 04:47

HI,

Have you tried the following in the web config file. Set the path to the images folder. It can be used for any static resources on disk.

Hope it help.

0 votesVote for this answer Mark as a Correct answer

Kamran Ansari answered on August 8, 2014 04:48 (last edited on August 8, 2014 04:48)

Please see below; Missed it in the earlier post.

<location path="custom/images">
<system.webServer>
  <staticContent>
    <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
  </staticContent>
</system.webServer>

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on August 8, 2014 04:56

Thanks Kamran,

Will this work if let's say I have sub folders inside "images" folder or do I need to specify each path in this case?

Best regards, Chetan

0 votesVote for this answer Mark as a Correct answer

Chetan Sharma answered on August 11, 2014 18:42

I tried this solution. Doesn't seem to work

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.