Jump to content

caching css


pascal_22
Go to solution Solved by kicken,

Recommended Posts

Hello!

 

I have a little question about caching... for now.. i dont use caching for my website. i want to start using it and i found i tuto here

 

so i'll start to using ExpiresByType

I have a question:

 

 

Warning! If you set a far future expiry date for something and then update one of those files, you must change the name of the file for the browser to re-fetch it.

 

If i start cached today, and tomorrow i edit my css file...

 

Should i have to rename it or i can just add parameter as <link rel="stylesheet" href="style.css?v34">

 

Will that work?

 

Also, Google talk about Expires, Does it the same as ExpiresByType?

 

Thanks a lot

 

PAscal

Link to comment
Share on other sites

  • Solution

Adding a query parameter is enough. What you need to change is the URL used to reference the file so that it appears as a different URL to the browser, forcing the browser to re-download it. Changing the actual file name is not required.

 

 

Expires is the name of the actual header used in the HTTP response to indicate when the resource expires. ExpiresByType is a configuration directive for apache that you use to define what the Expires header should be for files of a given type.

Edited by kicken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.