nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

adding cache with php files

This is a discussion on adding cache with php files within the Web servers forums, part of the Mastering Servers category; hello I tried to add cache handling to php files (which in my case are "static", their content doesn't change). ...


Go Back   nixCraft Linux Forum > Mastering Servers > Web servers

Linux answers from nixCraft.


Web servers Discussion on Apache, Nginx and Lighttpd HTTP/web server and configuration issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 24-01-2009, 11:04 PM
Junior Member
User
 
Join Date: May 2008
OS: Debian
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mumuri is on a distinguished road
Default adding cache with php files

hello

I tried to add cache handling to php files (which in my case are "static", their content doesn't change).

I created a .htacesss with

Code:
<FilesMatch "\.(jpg|jpeg|png|gif|css|php)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2099 20:00:00 GMT"
</FilesMatch>
it's work well with images and css files (i see the 304 return code), but not with php files

i tryed to do it by adding
Code:
header unset X-Powered-By
header unset Vary
but it still doesn't work

Note that i don't have access to the httpd.conf file, and that i can not rename the php file

Does someone has an idea to do it ?

Here is the header file
Code:
HTTP/1.1 200 OK
Date: Sat, 24 Jan 2009 18:39:49 GMT
Server: Apache/2.2.X (OVH)
X-Powered-By: PHP/4.4.9
Cache-Control: public
Expires: Thu, 15 Apr 2099 20:00:00 GMT
Vary: Accept-Encoding
Content-Type: text/html

thanks

Last edited by mumuri; 24-01-2009 at 11:12 PM.
Reply With Quote
  #2 (permalink)  
Old 13-03-2009, 12:40 PM
kasimani's Avatar
Senior Member
User
 
Join Date: Jul 2006
Location: India, Delhi
OS: CentOS, RedHat, Fedora, Ubuntu
Posts: 151
Thanks: 3
Thanked 1 Time in 1 Post
Rep Power: 4
kasimani is on a distinguished road
Send a message via Yahoo to kasimani
Default

if u are fetching data from Database in php then resultant could be cached by using Memcache.
Reply With Quote
Reply

Tags
apache , cache , php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Linux / UNIX: Adding a Directory to Your Path sweta Getting started tutorials 0 12-08-2008 07:03 PM
Adding Users in Bulk + Passwords and permissions ricksd2sd Shell scripting 0 23-04-2008 12:20 PM
Adding storage function to a mail server satimis Databases servers 0 04-01-2008 01:15 PM
Shell Script for adding, removing and commiting the SVN (Subversion system ) anilvrathod Shell scripting 0 07-12-2007 05:40 PM
problem in adding ip route ranjithtechser HP-UX 0 09-11-2007 05:28 PM


All times are GMT +5.5. The time now is 07:21 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38