Search code examples
cachingweb-configplesk

web.config file not being read by Google PageSpeed Insights


I have read through answers here and still stuck: IIS7 Cache-Control

I have the following web.config.xml file in the root directory of my website:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<system.webServer>

<staticContent>

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

</staticContent>

</system.webServer>

</configuration>

The purpose of this web.config file is to pass the Google PageSpeed Insight 'leverage browser caching' test. I am using Windows Plesk hosting, and therefore cannot use a .htaccess file for this.

No matter how I try and format the contents of the web.config file, Google does not seem to recognise any form of browser caching is occurring. I am not sure if it is just Google, or if it means that the images and other static resources on my page are being cached or not. Is there an easy way to check this?

Can anyone see any issues with my web.config.xml contents that might be causing the issue? Or is there anything else I need to do with it other than stick it in the root directory of my site?


Solution

  • The file name should be web.config and not web.config.xml *.config is already a xml type of file