Cached, PHP generated Thumbnails load slowly

前端 未结 19 2068
醉酒成梦
醉酒成梦 2020-12-12 11:35

Question Part A ▉ (100 bountys, awarded)
Main question was how to make this site, load faster. First we needed to read these waterfalls. Thanks all fo

19条回答
  •  死守一世寂寞
    2020-12-12 12:09

    I've found the URL of your website and checked an individual jpg file from the homepage. While the loading time is reasonable now (161ms), it's waiting for 126ms, which is far too much.

    Your last-modified headers are all set to Sat, 01 Jan 2011 12:00:00 GMT, which looks too "round" to be the real date of generation ;-)

    Since Cache-control is "public, max-age=14515200", arbitrary last-modified headers will could cause problem after 168 days.

    Anyway, this is not the real reason for delays.

    You have to check what your thumbnail generator do when the thumbnail already exists and what could consume so much time checking and delivering the picture.

    You could install xdebug to profile the script and see where the bottlenecks are.

    Maybe the whole thing uses a framework or connects to some database for nothing. I've seen very slow mysql_connect() on some servers, mostly because they were connecting using TCP and not socket, sometimes with some DNS issues.

    I understand you can't post your paid generator here but I'm afraid there are too many possible issues...

提交回复
热议问题