Image viewing problem

Discussion in 'PHP' started by som_ind, Nov 3, 2005.

  1. #1
    Actually recent i am working on a project where losts of images are showing from data base and all so the biger the image when mouse over. When the page load in the browser then every image load successfully and shows its mouse over correctly. But i have another two link form the home page.One for details of the image and another for search whcih shows the images according to a search key. But the problem is that when i click any one of thoes link and back to home page then the images again get downloading.

    Please reply for any suitable help.
     
    som_ind, Nov 3, 2005 IP
  2. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are loading the images from a database then I don't think web browsers are able to cache them.

    If you store the images normally in a folder and store the filename only in a database then browsers can cache them and pages will load faster.

    Alternatively you could try adding
    session_start();
    header("Cache-control: private");
    
    PHP:
    to your headers to prevent the page being reloaded on the second visit.
     
    dave487, Nov 4, 2005 IP