照片库页面加载缓慢......可能是什么问题?

时间:2010-08-05 00:13:25

标签: php performance

我有一个简单的php网站,但是由于某种原因,我的照片库页面需要很长时间才能加载。有人能说出问题是什么以及如何加快加载时间吗?

这是php代码。顺便说一下,我在这个文件中编写了所有内容(photography.php),只引用了另一个文件夹中的图像......

<?php

$thisPage="Photographer, Caribbean, Jamaica, Bahamas - Cheryl Blackerby";

$thisDescription="";

$thisKeywords="Caribbean, Jamaica, Bahamas";

include("header.php");

//include("html/photography.html");

?>

<div id="photography">

        <div id='coin-slider'>

            <div id="photos">

                <a href="#" target="_blank">
                    <img src='photography/img_01.jpg' alt="Staniel Cay Yacht Club in the Exumas, Bahamas" />
                    <span>Staniel Cay Yacht Club in the Exumas, Bahamas</span>
                </a>

                <a href="#" target="_blank">
                    <img src='photography/img_02.jpg' alt="Junkanoo dancer in Inagua, Bahamas" />
                    <span>Junkanoo dancer in Inagua, Bahamas</span>
                </a>

                <a href="#" target="_blank">
                    <img src='photography/img_03.jpg' alt="Doctor's Cave Beach in Montego Bay, Jamaica" />
                    <span>Doctor's Cave Beach in Montego Bay, Jamaica</span>
                </a>

                <a href="#" target="_blank">
                    <img src='photography/img_04.jpg' alt="Paella at the Beach House, Eleuthera, Bahamas" />
                    <span>Paella at the Beach House, Eleuthera, Bahamas</span>
                </a>

                <a href="#" target="_blank">
                    <img src='photography/img_05.jpg' alt="Opening of the Supreme Court, Nassau, Bahamas" />
                    <span>Opening of the Supreme Court, Nassau, Bahamas</span>
                </a>

                <a href="#">
                    <img src='photography/img_06.jpg' alt="Flamingos on Inagua, Bahamas" />
                    <span>Flamingos on Inagua, Bahamas</span>
                </a>    

            </div><!-- end photos -->

        </div>

        <p id="right-description"><img src="images/side-descrip-photos.jpg" width="20" height="90" alt="Photo Description" /></p>


<script type="text/javascript">
            $(document).ready(function() {
                $('#coin-slider').coinslider({ width: 840, height: 520, navigation: true, delay: 5000, links : false, hoverPause: true, opacity: 0.7, effect: 'practice', sph: 1, spw: 1 });
            });
        </script>

    </div><!-- end photography -->

<?php

include("footer.php");

?>

以下是该网站的链接:here

我很感激有关这个问题的任何建议以及任何有用的编码技巧。

谢谢,

Gary D。

2 个答案:

答案 0 :(得分:2)

对我来说很快很快 - 实际上速度非常快。

我会说它带宽很重,你是通过慢速连接尝试的。

关于它的一件事是你预加载所有大图像,即使你只显示最顶层的图像。这是一个好主意,除了它们出现在你的代码中比右边的导航更早,所以我想在一个缓慢的连接上,有一些等待所有大图像下载之前它显示右边的导航。你可以通过使用不同的方法使用JQuery预加载这些图像来解决这个问题,这样加载这些图像的请求就不会出现在页面上的其他图像之前。

答案 1 :(得分:0)

从这里开始:http://developer.yahoo.com/yslow/这是一个firefox插件,可以分析您的页面下载瓶颈。它可能与你的php代码无关。

相关问题