Overview
Comment:Fix expires header
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 999c215138178c82bec80222fd588328e62a459fb857670c55b919863b0a1dcc
User & Date: bohwaz on 2022-01-18 00:42:24
Other Links: manifest | tags
Context
2022-01-18
00:43
Oops HTTP header check-in: cc391ac04c user: bohwaz tags: trunk, stable
00:42
Fix expires header check-in: 999c215138 user: bohwaz tags: trunk, stable
00:41
Try to fix HTTP cache check-in: 515bfed47f user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Utils.php from [83140b5668] to [9dba988832].

872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
    {
        $etag = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH'], '"\' ') : null;
        $last_modified = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : null;

        $etag = $etag ? str_replace('-gzip', '', $etag) : null;

        header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $last_change)), true);
        header(sprintf('Expires: %s GMT', gmdate('D, d M Y H:i:s', $last_change)), true);
        header('Cache-Control: private', true);
        header_remove('Pragma');

        if ($hash) {
            header(sprintf('Etag: "%s"', $hash), true);
        }








|







872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
    {
        $etag = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH'], '"\' ') : null;
        $last_modified = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : null;

        $etag = $etag ? str_replace('-gzip', '', $etag) : null;

        header(sprintf('Last-Modified: %s GMT', gmdate('D, d M Y H:i:s', $last_change)), true);
        header(sprintf('Expires: %s GMT', gmdate('D, d M Y H:i:s', $last_change + 3600)), true);
        header('Cache-Control: private', true);
        header_remove('Pragma');

        if ($hash) {
            header(sprintf('Etag: "%s"', $hash), true);
        }