PageSpeed Insights 和 GoDaddy [=10th=] 托管

PageSpeed Insigths and GoDaddy Windows Hosting

我的网页缓存有问题。 我的网页由 GoDaddy 托管,经济 Windows 服务器与 Plesk。

conexaomktdigital.com.br

这是一个非常简单的网站,我没有在上面使用 PHP,只有 HTML、CSS 和简单的 bootstrap JS。

当我 运行 PageSpeed Insights 时,结果告诉我优化浏览器缓存,包括为我的 .css 和图像添加过期日期。
手机:60/100
台式机:75/100

我该怎么做?我到处寻找,什么也没看到,每个人都在谈论 .htaccess,但它不是 apache,它是 windows with plesk by GoDaddy...我该怎么办,有人可以帮助我吗?

创建并使用正确的 'Web.Config' 文件。把它放在你的根文件夹中。 您可以在此处找到有关如何使用带有正确标签的 web.config 文件的一些信息:
https://www.giftofspeed.com/leverage-browser-caching/
我使用了一个非常简单的配置,它似乎对我来说很好用:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
        <caching enabled="true" enableKernelCache="true">
      <profiles>
        <add extension=".html" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
        <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
        <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
        <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
        <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange"/>
      </profiles>
    </caching>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>

这会将列出的文件保留在缓存中,直到它有一些变化。 对我来说没有 Error 500,我想它也不会发生在你身上。