jquery ui 图像加载性能不佳
我在 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>
但无济于事。
I'm using Jquery UI (jquery-ui-1.8.13.) in asp.net mvc 3 application.
In local (IIS express), it always loads http://localhost:19992/content/redmont/images/ui-icons_f9bd01_256x240.png, for every page.
Its slow. I guess static caching is not working in IIS express. Web.config which I have defined in Content folder:
<?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>
but to no avail.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在本地主机下的 IIS Express 上运行站点时,所有缓存都会被禁用。这是一件好事,因为您很可能仍在构建/调试该站点。在那个阶段,缓存 javascrip 和 css 等静态内容可能会非常令人困惑。
完成站点构建后,您可以将其上传到 IIS,静态缓存应该可以正常工作。
由于您对性能感兴趣,您可以使用其他一些有用的 web.config 设置,但它们也不适用于本地主机。
When you run a site on IIS Express under local host, all caching is disabled. This is a good thing, because you are most likely still building/debugging the site. Caching static content such as javascrip and css can be very confusing at that stage.
When you finish building the site, you can upload it to IIS, and the static caching should work just fine.
Since you are interested in performance, you may use some other helpful web.config settings, but they will also not work with localhost.