dongranding3909 2011-03-09 22:15
浏览 18

获取缩略图时降低网页的整体下载速度......怎么样?

I am fetching many thumbnails in my application from a database/remote server and loading these in a list View (ul). When there are, around, 100 thumbnails, the overall dowload speed of the webpage is reasonable, but when i am fetching around 250 + thumbnails, the overall download speed is noticeable slower...

I know that I could use pagination, but in my case, that is not an option...

The total number of thumbnails I will end up fetching is around 500... It will not get higher...

My question is the following:
Is there a way I could speed up the fetching of thumbnails in my application? I heard about maybe caching the thumbnails in a file and then calling that file... is that the best solution? if yes, can somebody guide me on that issue...

Any hints? Thank you in advance.

Marco

EDITED

what about using something that i've read... something similar to the following method:

$cache = 'cache/thumbnails.cache.php';

if (!file_exists($cache)) { // check also for the expiration date

   echo "this is a cached copy... <br />";
   include($cache);

} else

   // start the output buffer
   ob_start();

   // INSERT php script to show thumbnails...

    $fh = fopen($cache, 'w+') or die ('Error...');
    fwrite($fh, ob_get_contents());
    fclose($fh);

    // send the output to the browser
    ob_end_flush();

}

is that a recommended method?

  • 写回答

3条回答 默认 最新

  • dongsu1951 2011-03-09 22:20
    关注

    Load the thumbnails as the user scroll down the page. Make the page dynamic, when the user is next to the bottom, you load more 4 rows of thumbnails for example.

    The way you're doing you're probably using a lot of unnecessary bandwith of the other server, as the user may not look the latest thumbnails at the bottom of the page.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题