tags:

views:

65

answers:

2

Hi all,

Thanks in advance for your help with this. I've got a very simple PHP file that returns HTML code for an image based on some passed parameters. The code works fine, and the image shows up quickly. However, the page itself doesn't finish loading for a good 5 seconds, which is interfering with some AJAX calls I'm trying to do. Firebug says the time breakdown is like this:

  • 0ms: DNS lookup
  • 0ms: Connecting
  • 0ms: Queuing
  • 211ms: Waiting for response
  • 14ms: Receiving data
  • +5.32s: 'DOMContentLoaded' (event)
  • +5.33s: 'load' (event)

Here's my PHP code:

<?php

$getimage = $_GET['p'];
$getcity = $_GET['c'];

?>

<img src="/images/photos/big/<?php echo $getcity; ?>_<?php echo $getimage; ?>.jpg" alt="" class="gallery" />

Pretty simple, no? Any idea what's going on?

+1  A: 

In response to Kaivosukeltaja - no, nothing else. Just the image. The code I posted above is literally the only code in the entire PHP file.

Jack
A: 

This page is using "/images/photos/big/" which I assume means it's using a "big" image. images take time to render, this is likely the slowdown.

you might be able to speed this up by setting the image height and width because the DOM will not know where everything is placed until the image size is known. I am not positive if this will fix the problem, sorry.

Mike Valstar