Welcome Guest, Not a member yet? Register   Sign In
Output Class bug - Last-modified header
#1

There appears to be a bug in core/Output.php in CI 3.0.

On like 677 of Output.php, there is this line:
$last_modified = filemtime($cache_path);

The $last_modified value is used to set the Last-modified header for conditional caching on the client (used on subsequent HTTP requests to determine whether a 304 Not Modified response is allowed).

However, if you look at the code, you see that $cache_path is pointing to the cache DIRECTORY, not the specific cache FILE that we are trying to get the timestamp for. The result is inaccurate modification times, that basically prevent 304 responses on any busy site.

The correct line should use $filepath, which points to the actual cache file:
$last_modified = filemtime($filepath);

-Kyle
Reply
#2

Did you report the issue on github?
Reply
#3

(This post was last modified: 04-23-2015, 01:27 PM by ivantcholakov.)

We might forget about this bug, I will make a report in GitHub.

Edit: https://github.com/bcit-ci/CodeIgniter/pull/3801
Reply
#4

Report about the bug on github and than x for the bug notification.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB