【问题标题】:jquery ui images load poor performancejquery ui 图像加载性能不佳
【发布时间】:2011-12-07 12:39:07
【问题描述】:

我在 asp.net mvc 3 应用程序中使用 Jquery UI (jquery-ui-1.8.13.)。

在本地(IIS express)中,它总是为每个页面加载 http://localhost:19992/content/redmont/images/ui-icons_f9bd01_256x240.png。 它的缓慢。我猜静态缓存在 IIS express 中不起作用。我在 Content 文件夹中定义的 Web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="UseExpires" httpExpires="Sun, 01 Dec 2019 00:00:00 GMT" cacheControlCustom="" />
        </staticContent>
    </system.webServer>
</configuration>

但无济于事。

【问题讨论】:

  • 使用localhost时,静态图片不会被缓存。
  • 有什么解决办法吗?

标签: jquery asp.net-mvc-3 jquery-ui caching


【解决方案1】:

当您在本地主机下的 IIS Express 上运行站点时,所有缓存都被禁用。这是一件好事,因为您很可能仍在构建/调试站点。在那个阶段缓存静态内容(例如 javascrip 和 css)可能会非常混乱。

当您完成站点构建后,您可以将其上传到 IIS,静态缓存应该可以正常工作。

由于您对性能感兴趣,您可以使用其他一些helpful web.config settings,但它们也不适用于 localhost。

【讨论】:

    猜你喜欢
    • 2022-01-24
    • 1970-01-01
    • 2015-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多