简体   繁体   中英

why is my gallery page taking so long to load?

When I go to this page of the site I'm building: http://test.kianistudios.com/placepigalle/gallery.php

it takes insanely long to load. In fact, as I scroll down the page (in Chrome), even the background doesn't load and there's just transparent backgrounds: http://oi61.tinypic.com/2zqttox.jpg and it freezes and lags for about 15 seconds before it fully loads. I have no idea why, other websites have hundreds of images much larger and they load with a breeze.

Here is my code http://pastebin.com/raw.php?i=y6EqeFTW

Many thanks!

Use your F12 dev tools / Firebug / Chrome network tab:

  1. Images are too large (not optimized for web) see this post (217 MB of downloaded material - as someone else mentioned this is probably your biggest hit in terms of time)
  2. You're making too many requests for js files - browsers are limited on the number of simultaneous requests and so it is having to wait to downoad your js files until the images are done.
  3. Your PHP script took 9.5 seconds to run at least one time after refreshing. Take a look at your code in PHP and see about how to optimize it.
  4. jQuery isn't loading - 404 at "js/vendor/jquery.js"

这需要很长时间,因为您正在以全分辨率加载所有图像,而不是生成缩略图。

Here's a link to a breakdown of how your site loads as evaluated by Pingdom tools: http://tools.pingdom.com/fpt/#!/dS6XMu/http://test.kianistudios.com/placepigalle/gallery.php

It appears that you are trying to force the user to download 122+ Megabytes of images in order for them to see your page. That's insane. Try generating thumbnails, using browser caching, and reducing the number of request connection timeouts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM