diff options
author | Andrey Andreev <narf@devilix.net> | 2014-12-03 19:15:56 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-12-03 19:15:56 +0100 |
commit | 16153d811c3484b9211c3b0079d1446a992bad1c (patch) | |
tree | bc9a6f280b50e024047fd843566748d887e79a9e | |
parent | d51d92af6761f30dd459c93fdb9f62d2d7b30a98 (diff) | |
parent | af14e26e72ed484b2388b88bf8df245c2490a387 (diff) |
Merge pull request #3384 from ster/develop
issue #2349 : Page caching with querystring
-rw-r--r-- | system/core/Output.php | 9 | ||||
-rw-r--r-- | user_guide_src/source/changelog.rst | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 8b7d6efbd..081423c99 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -564,6 +564,9 @@ class CI_Output { .$CI->config->item('index_page') .$CI->uri->uri_string(); + // append querystring + empty($_SERVER['QUERY_STRING']) OR $uri .= '?'.$_SERVER['QUERY_STRING']; + $cache_path .= md5($uri); if ( ! $fp = @fopen($cache_path, 'w+b')) @@ -648,6 +651,9 @@ class CI_Output { // Build the file path. The file name is an MD5 hash of the full URI $uri = $CFG->item('base_url').$CFG->item('index_page').$URI->uri_string; + // append querystring + empty($_SERVER['QUERY_STRING']) OR $uri .= '?'.$_SERVER['QUERY_STRING']; + $filepath = $cache_path.md5($uri); if ( ! file_exists($filepath) OR ! $fp = @fopen($filepath, 'rb')) @@ -727,6 +733,9 @@ class CI_Output { $uri = $CI->uri->uri_string(); } + // append querystring + empty($_SERVER['QUERY_STRING']) OR $uri .= '?'.$_SERVER['QUERY_STRING']; + $cache_path .= md5($CI->config->item('base_url').$CI->config->item('index_page').$uri); if ( ! @unlink($cache_path)) diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f01ff8a5d..f336b3ae4 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -500,6 +500,7 @@ Release Date: Not Released - Added methods ``get_content_type()`` and ``get_header()``. - Added method ``delete_cache()``. - Changed caching behavior to compress the output before storing it, if ``$config['compress_output']`` is enabled. + - Added querystring to page caching. - :doc:`Config Library <libraries/config>` changes include: |