Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Problems with disabling browser caching using the headers |
|
Author |
|
Ishan
Joined: 30 Mar 2016 Posts: 5
|
Posted: Wed 06 Apr '16 17:29 Post subject: Problems with disabling browser caching using the headers |
|
|
HI
Setup : Apache 2.2.29 with mod_headers enabled.[Windows]
Problem : I am using "Cache-Control" to stop caching of pages. It works fine for html pages but 2files on my project that are javascript files are cached according to a vulnerability scanner.
Is there a way to avoid this with mod_headers ?
Code :
apr_table_add(r->err_headers_out, "Cache-Control", "no-cache, no-store"); |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 08 Apr '16 17:34 Post subject: |
|
|
With mod headers you can simply use you apache config.
Like
Code: | Header always edit Cache-Control "no-cache, no-store" |
http://httpd.apache.org/docs/current/mod/mod_headers.html#header
I use mod_expires to do the oposite from you.
Code: |
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType image/png A2592000
ExpiresByType text/javascript A2592000
ExpiresByType image/icon A2592000
ExpiresByType application/javascript A604800
ExpiresByType image/x-icon A2592000
|
You can set it down to a single second. That will prevent caching.
if you still have a question please ask again. |
|
Back to top |
|
|
|
|
|
|