Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-19-2012, 12:46 AM   #1
p3rsian
Confirmed User
 
Join Date: Sep 2003
Posts: 1,050
Setting up cache control header in htacces files

i am trying to tell browsers to get a fresh copy of the site (JOOMLA based) after x hours using this code in htaccess.
main question is if its ok to put PHP file in there . i could not find a site that has it but since its index.php homepage i need it.

Code:
# 2 HOURS
<filesMatch "\.(html|htm|PHP|css|js)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
thanx 4 helping
__________________
boro en harfa chei
p3rsian is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 01:00 PM   #2
p3rsian
Confirmed User
 
Join Date: Sep 2003
Posts: 1,050
234567
p3rsian is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 01:25 PM   #3
phypon
Confirmed User
 
Join Date: Oct 2003
Posts: 440
I've only recently had experience with far future expires headers. Off the top of my head I don't think PHP will matter one way or another. HTML/CSS/js would be how content and images are displayed. Those would be what would need to be cached.
phypon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 01:30 PM   #4
AzteK
Confirmed User
 
AzteK's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: Northern Cali, USA
Posts: 3,443
Quote:
Originally Posted by p3rsian View Post
i am trying to tell browsers to get a fresh copy of the site (JOOMLA based) after x hours using this code in htaccess.
main question is if its ok to put PHP file in there . i could not find a site that has it but since its index.php homepage i need it.

Code:
# 2 HOURS
<filesMatch "\.(html|htm|PHP|css|js)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</filesMatch>
thanx 4 helping
to boro, batcheh mekhad htaccess yad begireh. Mamanet medooneh to enja hasty?
AzteK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 03:29 PM   #5
RazorSharpe
Confirmed User
 
RazorSharpe's Avatar
 
Industry Role:
Join Date: Aug 2001
Location: Scotland
Posts: 2,238
Quote:
Originally Posted by AzteK View Post
to boro, batcheh mekhad htaccess yad begireh. Mamanet medooneh to enja hasty?
Been a long while since I've heard Farsi
__________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
RazorSharpe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 03:52 PM   #6
AzteK
Confirmed User
 
AzteK's Avatar
 
Industry Role:
Join Date: Feb 2001
Location: Northern Cali, USA
Posts: 3,443
Quote:
Originally Posted by RazorSharpe View Post
Been a long while since I've heard Farsi
toh az koja medooni?
AzteK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-19-2012, 04:39 PM   #7
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
PHP or not doesn't matter. That's fine for all of the standards compliant browsers. The tricky part is that for IE you need to tell it to not cache in three different ways in order for it to be reliable.

For older versions of IE, that needs to include in the <head> which must be placed at the ends of the document, or at very least place the caching adjectives at the end of the head. The problem is that since IE doesn't cache anything less than 512 bytes anyway, so when it refs the headers it hasn't yet decided to turn on cache, so that's too early to turn off the cache.

On the other hand, IE doesn't know how to handle the Vary header, so it skips when thete is any Vary header. If you set it to Vary on hostname or URL that shouldn't hurt anything because OF COURSE different URLs have different content, but IE isn't smart enough to figure that out, so it skips caching.
__________________
For historical display only. This information is not current:
support&#64;bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.