@ssu1
Also, one remark about the generation of the Expires
header I’ve forgotten to write about earlier.
By setting the add_expires_header
to false
, Add-Headers is instructed to stop generating the Expires
header. But, please keep in mind that WordPress itself, another plugin, or the web server could add an Expires
header to the response.
If you disable the generation of the Expires
header in Add-Headers, but you still see an Expires
header in the web server response, then that Expires
header has not been added by this plugin. Your best bet would be to check the web server configuration (main, virtualhost and htaccess if you are using apache) in such a case.
BTW, what I had mentioned earlier has been implemented in 1.2.1 which will be out soon.
To stop Add-Headers generate the Expires
header, add this code to the functions.php
file of the theme or in a custom plugin:
function addh_custom_options ( $options ) {
$options['add_expires_header'] = false;
return $options;
}
add_filter( 'addh_options', 'addh_custom_options' );
To remove the Pragma
header or any other header (including the Expires
header I mentioned above) generated by this plugin, use this code:
function addh_filter_final_headers ( $headers ) {
unset($headers['pragma']);
//unset($headers['cache-control']);
//unset($headers['expires']);
//unset($headers['last-modified']);
//unset($headers['etag']);
return $headers;
}
add_filter( 'addh_headers', 'addh_filter_final_headers' );
Hope this helps. Bare in mind, this is sample code. Some more checking might be required in some cases. Feel free to ask any questions.
Marking the topic as resolved.
George