Forum Moderators: open

Message Too Old, No Replies

Background image doesn't get cached in IE

a php-nuke site

         

gaston9x19

9:54 am on Aug 2, 2004 (gmt 0)

10+ Year Member



I'm trying to get a php-nuke site to stop having to reload a rather large background picture every time a new page is opened. How can I get it to load the background picture into IE cache? These are the current META tags:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 31 Jan 2005 23:59:59 GMT">
<META NAME="RESOURCE-TYPE" CONTENT="DOCUMENT">
<META NAME="DISTRIBUTION" CONTENT="GLOBAL">
<META NAME="AUTHOR" CONTENT="United Squads">
<META NAME="COPYRIGHT" CONTENT="Copyright (c) 2003 by United Squads">
<META NAME="KEYWORDS" CONTENT="News.... etc, etc.">
<META NAME="DESCRIPTION" CONTENT="Your slogan here">
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<META NAME="REVISIT-AFTER" CONTENT="1 DAYS">
<META NAME="RATING" CONTENT="GENERAL">
<META NAME="GENERATOR" CONTENT="PHP-Nuke 7.0 - Copyright 2003 by [phpnuke.org">...]

I tried changing the "Expires" tag from 0 to a real date based on another forum I read here that cited vancouver-pages. I guess it was ferring to search engine caches, not IE temporary internet files caches. Can someone please help me?

<Note: split from another thread>

[edited by: tedster at 7:39 pm (utc) on Aug. 2, 2004]

tedster

3:48 am on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forum, gaston.

I recently had a similar issue with a small background image that I used as a css hover effect. So I called two short lines of javascript from the head of every page (in my case I added them to an external .js file) to preload the image, and now the image seems to be called from the cache just fine -- always at the ready.

imagebg=new Image(16,14)
imagebg.src="backgroundimage.gif"

gaston9x19

4:22 am on Aug 3, 2004 (gmt 0)

10+ Year Member



May I please have a link to the site in use? What's the 16,14 for? And how do you tell it to use the cached image for the background?

<script language=javascript>
imagebg=new Image(16,14)
imagebg.src="themes/TransparentBlue/images/us3.jpg"
</script>

That by itself obviously isn't enough to get it. Much appreciated. :)

tedster

4:57 am on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The (16,14) is just the image's width and height. You can leave the parens blank -- new Image() -- I'm just in the habit of filling it in.

Yes, what you have (if you drop the 16,14) should be enough to force the image into the cache. It doesn't display the imnage, in and of itself. Be sure to use the exact same form of the url that your background image uses, and then IE should reference its cache for all future pages.

I don't know why the background images tend to be flakey in regards to caching, but they do. Try this out - it is a small amount of code and you should be able to see right away if it helps your situation. I can only say for sure that it helped mine.

<sorry, but we don't do links to example sites here - see TOS [webmasterworld.com]>)

gaston9x19

7:04 am on Aug 3, 2004 (gmt 0)

10+ Year Member



Well it's still loading the image everytime you navigate to a new page with the same bg pic, but thanks for your help. It was worth a shot. I'll keep looking.

kaled

9:17 am on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a vague idea that I read somewhere that this can occur when absolute urls are used. In the same discussion, I think the javascript method was mentioned to eliminate first-use delays for mouse-over images, etc.

My memory is very sketchy on this, but if the image's url is absolute, definitely try using a relative one.

Kaled.