• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1109
  • Last Modified:

apache configure

i want to add the follwoing line: <FilesMatch "^rahul\.cgi$">
ExpiresActive on
ExpiresDefault A1
Header unset Cache-Control:
Header append Cache-Control: "no-store, no-cache, must-revalidate"
</FilesMatch>

to prevent browser from cache:

 i tried to add those lines in 2 different files:

1) in same file as rewrite rule
2) htttpd.conf file

doesn't works:

get th eerror:
Invalid command 'ExpiresActive', perhaps mis-spelled or defined by a module not included in the server configuration

0
shahrahulb
Asked:
shahrahulb
1 Solution
 
caterham_wwwCommented:
Did you remove the # from the beginning of the lines

LoadModule expires_module modules/mod_expires.so and
AddModule mod_expires.c

from httpd.conf that the module mod_expires is loaded?
0
 
shahrahulbAuthor Commented:
it is already uncommented
0
 
shahrahulbAuthor Commented:
oops sorry

i don't have this line
LoadModule expires_module modules/mod_expires.so and
AddModule mod_expires.c

in httpd.conf
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
shahrahulbAuthor Commented:
i added     LoadModule expires_module modules/mod_expires.so and
AddModule mod_expires.c

in httpd.conf


the i also added
<FilesMatch "^rahul\.cgi$">
ExpiresActive on
ExpiresDefault A1
Header unset Cache-Control:
Header append Cache-Control: "no-store, no-cache, must-revalidate"
</FilesMatch>

in httpd.conf


still  its caching the data
0
 
shahrahulbAuthor Commented:
i still don't know why it shappening like this.

if i open in new window then it request from the server but on the same window it is taking data from cache

why??
0
 
ramazanyichCommented:
first your Header directives contains error. Remove ":" sign. It should be:
Header unset Cache-Control
Header set Cache-Control "no-store, no-cache, must-revalidate"
try to set also Expires header:
Header unset Expires
Header set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
0
 
ramazanyichCommented:
additionally you can set Prgama: no-cache header
Header set Pragma no-cache
0
 
shahrahulbAuthor Commented:
its working 50% now.   :-)

one last issue is:
i have configued apache such that as soon as it sees file offline.html in /v/trap/akl/  directory
it redirects to a page... this is working fine...after cache setting.

once i remove file offline.html then it does not reirects and works normally....this also works fine

now if again i place the offline.html, it does not redirect if i do on them same window, i have to open a new window....why??

Rahul
0
 
shahrahulbAuthor Commented:
which means without offline.htm it is still caching

but with offline.html it is not caching after adding the above line in my http.conf file
0
 
ramazanyichCommented:
how do you configure redirection ?
using RewriteEngine ?
0
 
shahrahulbAuthor Commented:
yes
0
 
shahrahulbAuthor Commented:
rewrite rule
0
 
shahrahulbAuthor Commented:
f i open in new window then it request from the server but on the same window it is taking data from cache
0
 
moduloCommented:
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now