问题
I'm trying to figure out why this website keeps loading, possibly to answer why it loads very slowly (but only sometimes, which might have to do with the hosting).
http://nothankstoyouproductions.com/
Does anyone have any clues?
回答1:
You are loading a quite a few resources, including 47 images, 22 Javascript files, and 10 CSS files. Every resource you load costs you in two ways. The server has to retrieve and server the file and the file has to transfer over the net, so the first thing I'd do is try to reduce that raw load. That is, combine your images into sprites if you can or reduce the number of images. Combine your Javascript or reduce it. Unfortunately, most of this requires some technical (PHP/JS/HTML/CSS) ability.
There are a couple of things that you could add to your .htaccess file that should help.
Encourage caching:
<FilesMatch "\.(ico|jpg|jpeg|png|gif|swf)$">
ExpiresActive On
ExpiresDefault "access plus 2 weeks"
</FilesMatch>
Send gzipped text:
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|bz2|sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
Be aware that each of those require common but not universal Apache modules. If you have problems, delete one or both of them.
I would also encourage you to look into either WP Super Cache or W3 Total Cache. One or the other of those may do more for you than anything. Caching plugins can be twitchy though and don't always play nice with other plugins, so move cautiously.
回答2:
Your site is heavy, as pointed out by s_ha_dum, and can benefit from browser caching, gzipping and a good cache plugin like WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/ WP Super Cache also has its own plugins for gzipping and minifying. (W3 Total Cache hasn't been updated in a year).
You can use Developer Tools (available for all browsers) or Firebug http://getfirebug.com/ in Firefox to see what is taking so long to load.
But also realize that you are loading a lot of items from external servers you have no control over, like Facebook, Sharethis and Pinterest. If they happen to be slow, or the bandwidth of your webhost - hostable.com - happens to be slow, that will account for the constant loading of the site.
Best idea is to go with a good and reputable host; that's the bottom line in trying to increase site performance.
回答3:
In my case, I had broken anchors (<a>), that causes the bug :/
来源:https://stackoverflow.com/questions/12871084/wordpress-loads-forever