CSS

Joined
Jan 15, 2003
Messages
4
Reaction score
16
Points
3
Location
Whangarei, New Zealand
Your Mac's Specs
Pwnt
I love css :)

But.... does anybody know of a way I can stop the caching of the css file (it's linked to with the <link rel=> tag)? Do I have to put the whole thing in the head, or is there a way I can avoid that?
 
M

meerk

Guest
muso said:
I love css :wub:

But.... does anybody know of a way I can stop the caching of the css file (it's linked to with the <link rel=> tag)? Do I have to put the whole thing in the head, or is there a way I can avoid that?

The best way to use CSS is to import it eg. <link rel="stylesheet" etc> OR the '@import' method (used primarily to avoid NS 4.0 users - doesn't like CSS)

This way it will override any CSS you put in your <head> tags. That's why it's called 'Cascading Style Sheets'

meerk…
 
OP
muso
Joined
Jan 15, 2003
Messages
4
Reaction score
16
Points
3
Location
Whangarei, New Zealand
Your Mac's Specs
Pwnt
meerk said:
The best way to use CSS is to import it eg. <link rel="stylesheet" etc> OR the '@import' method (used primarily to avoid NS 4.0 users - doesn't like CSS)

This way it will override any CSS you put in your <head> tags. That's why it's called 'Cascading Style Sheets'

meerk…

Yes, I am currently using <link rel="stylesheet...>. My problem is that the browser caches the file styles.css (referred to in the <link> tag).

No caching occurs if I embed the whole stylesheet in the head, but with a large stylesheet this is impractical if I want to change a global attribute.
 
U

urbandyke

Guest
you could use an include (either ssi or php) for the styles in the head if it's for practicality. :)
 
Joined
Jun 11, 2003
Messages
4,915
Reaction score
68
Points
48
Location
Mount Vernon, WA
Your Mac's Specs
MacBook Pro 2.6 GHz Core 2 Duo 4GB RAM OS 10.5.2
No because cache is usually on the client side and not the server side.. which ssi and php are both server side.

You can send commands to the browser so that it will not cache the content, but since there are so many bugs in browsers.. it doesnt seem to work anymore.

Here is a page that has a decent breakdown:

http://www.htmlgoodies.com/beyond/nocache.html
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top