我正在尝试优化我的网站的加载时间,因为它太长,它仍然是jQuery UI CSS图像,

如果你有一分钟,可以看看这个pingdom测试

在文件号60和75中,jQuery CSS文件中几乎没有图像(只重命名为路径)。它们最多需要3秒钟来连接,然后它们似乎加载。但是 3 秒连接?

与此相关的CSS:

.ui-icon { width: 16px; height: 16px; background-image: url(/css/images/ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(/css/images/ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(/css/images/ui-icons_222222_256x240.png); }
.ui-state-default .ui-icon { background-image: url(/css/images/ui-icons_888888_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(/css/images/ui-icons_454545_256x240.png); }
.ui-state-active .ui-icon {background-image: url(/css/images/ui-icons_454545_256x240.png); }
.

和此CSS文件的路径为: /CSS/ui.css

和图像路径是: /CSS/images/*.png

如果这不是关于路径,我完全丢失了这里,任何线索?

有帮助吗?

解决方案

The other thing to think about is that your browser uses caching. So, when you run a test like this it will look like JQuery UI images are horribly slow. But to the user (with a proper browser caching setup in place) the "penalty" will only happen once. So, in reality it's not an entirely fair test.

I'd worry more about your 40kb background image and less-than-perfectly-optimized CSS. Try this website on your css document to drop 13% of it's overhead (on the main site css) Also, you could benefit by combining the CSS documents together, which will lower HTTP overhead. Again, thanks to the concept of browser caching this would be a one-time only improvement for a properly setup browser.

Compared to many sites out there, this one loads quite quick. Unless your site is going out to 20+million daily, or you're paying by the kb for bandwidth, the setup is more than adequate.

其他提示

I am not seeing that long of a delay. It looks like they take less than a second to load.

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top