4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Includes and caching
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 4:32 pm (15 years, 6 months ago) Reply with QuoteBack to Top

This one may seem a little strange but here we go,

I include my menubar in each of my pages, but I can't have graphics, as I have to put <img src="http://www.mysite.com/img/img.gif"> for it to work in each page, the trouble with this is, that every time you change page, it reloads the graphics, rather than caching them, as it does if I use relative paths, but I can't use relative paths, because www.mysite.com, with an include would be just <img src="imagename.gif">, but this would be wrong, if I had a file in a sub-directory, and the graphic wouldn't show up.

Any Ideas?

Thanks
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 4:40 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Use
Code:
<img src="/img/img.gif">

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 5:08 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Daniel wrote:
Use
Code:
<img src="/img/img.gif">

Grrrrrr, I design professional sites and I didn't know you could do that!!!! I thought that ment change directory rather than from the root, but then again, it shows how dense I am!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 5:57 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Did you know you could use links like that? 'Cause we've used that kind of link all over this site!

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 6:16 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Daniel wrote:
Did you know you could use links like that? 'Cause we've used that kind of link all over this site!

I know, I just had a look, I always thought "/dir/" was the same as dir/
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 6:24 pm (15 years, 6 months ago) Reply with QuoteBack to Top

I wouldn't waste my time adding all those slashes if they weren't needed! And how did you think a link from /tutorials/ to /links/ would work? Wouldn't you have thought that it linked to /tutorials/links/? That wouldn't make sense!

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 6:49 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Daniel wrote:
I wouldn't waste my time adding all those slashes if they weren't needed! And how did you think a link from /tutorials/ to /links/ would work? Wouldn't you have thought that it linked to /tutorials/links/? That wouldn't make sense!

I would do ../links/ Smile
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 6:51 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Yes, but didn't you wonder how OUR links worked? (or those on other sites who use this technique)

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 7:01 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Daniel wrote:
Yes, but didn't you wonder how OUR links worked? (or those on other sites who use this technique)
No, because I never looked at your source until you pointed it out above, I just always thought it was like how I outlined above, I'm thick for not knowing it I know, but thats just the way it is, as I usually use text links so it's not a problem.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 7:02 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Why wouldn't it be a problem?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 7:05 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Because I just used URL's, the difference with images, is if you call them with URL's they are not cached, so every page change involves them being reloaded, if you call them locally they are cached.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun May 26, 2002 7:07 pm (15 years, 6 months ago) Reply with QuoteBack to Top

I wonder why... It's a little stupid IMO. If the browser is going to cache pages with absolute URL's, why doesn't it cache images... Confused

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun May 26, 2002 7:15 pm (15 years, 6 months ago) Reply with QuoteBack to Top

Daniel wrote:
I wonder why... It's a little stupid IMO. If the browser is going to cache pages with absolute URL's, why doesn't it cache images... Confused

Well it doesn't in Internet Explorer 6.0 or Internet Explorer 6.0SP1 Anyway!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.067998 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme