PDA

View Full Version : PHP & Caching


IBethune
2004.08.04, 01:59 AM
Take a look at the template for my new website at http://www.pyramid-productions.net/newsite The "News" link works, but there's no back link as yet.

Anyway, it's all written in PHP, and seeing as how the pages all have much the same layout each page takes the form of

<?php
include ("templates/top.html");
?>
<!-- MAIN PAGE CONTENT GOES IN HERE -->
<!-- END OF MAIN PAGE CONTENT -->
<?php
include ("templates/bottom.html");
?>

i.e. I include the standard top and bottom of the page to get the layout, and just have the data that changes in the actual file.

Now the problem is that the top and bottom bits of the pages have lots of graphics in them (check out the site to see) and every time I load a page, it reloads all the graphics... it seems that they are not cached by the browser. Anybody have any experience in this or know how to fix it?

Warning: The site is not 100% IE compliant yet - I'm working on it. Displays perfectly in Safari & Opera though...

Cheers

- Iain

Psork
2004.08.08, 05:47 AM
Not answering your question, but here under win32 firefox the images have yucky blue borders around them.

Oh, I see. Your stylesheet says "IMG {border: 0;}", when I think it should say "IMG {border: none;}" (untested).

Edit: "IMG {border: 0;}" seems to work on your old website. I have no idea what's going on.

madmacgames
2004.08.08, 11:47 AM
on OS X 10.3.4; Safari, Firefox, Camino, Opera, and IE 5.2 all cached the images no problem. They did not reload between pages.

If you still are having problems you might try this META tag:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PUBLIC">