diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-12-27 19:59:09 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-12-27 19:59:09 +0000 |
commit | 967d64ade5439a87b8d24daa0e35739b8687a879 (patch) | |
tree | 318eb269ca6e0c242edfa4d8151178b3cb33c080 /sapi | |
parent | ff8adda7c65a5063319b00160cbf8abbe753a0a8 (diff) | |
download | php-git-967d64ade5439a87b8d24daa0e35739b8687a879.tar.gz |
Fixed bug #17098 (make Apache aware that PHP scripts represent dynamic data
and should not be cached). Fix suggested by daniel.eckl@gmx.de.
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/apache2filter/sapi_apache2.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index cd127fbd91..a999369df5 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -261,6 +261,17 @@ static void php_apache_sapi_log_message(char *msg) } } +static int +php_apache_disable_caching(ap_filter_t *f) +{ + /* Identify PHP scripts as non-cacheable, thus preventing + * Apache from sending a 304 status when the browser sends + * If-Modified-Since header. + */ + f->r->no_local_copy = 1; + + return OK; +} extern zend_module_entry php_apache_module; @@ -654,8 +665,8 @@ static void php_register_hook(apr_pool_t *p) ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_insert_filter(php_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_post_read_request(php_post_read_request, NULL, NULL, APR_HOOK_MIDDLE); - ap_register_output_filter("PHP", php_output_filter, NULL, AP_FTYPE_RESOURCE); - ap_register_input_filter("PHP", php_input_filter, NULL, AP_FTYPE_RESOURCE); + ap_register_output_filter("PHP", php_output_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); + ap_register_input_filter("PHP", php_input_filter, php_apache_disable_caching, AP_FTYPE_RESOURCE); } AP_MODULE_DECLARE_DATA module php4_module = { |