X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fvier%2Fstyle.php;h=dba758ca24eb374fd7e661761789fd481ca3df0d;hb=8167e75e6a213db396f2be470801c8a4fda6f0be;hp=e118d1ef0905cf77b11001f65156a11732c5fba0;hpb=5a23bd400c417545d23c0a9925f8dc3b86e6ecc8;p=friendica.git diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php index e118d1ef09..dba758ca24 100644 --- a/view/theme/vier/style.php +++ b/view/theme/vier/style.php @@ -1,12 +1,7 @@ $modified) + $modified = $stylemodified; +$modified = gmdate('r', $modified); +$etag = md5($stylecss); + +// Only send the CSS file if it was changed +header('Cache-Control: public'); +header('ETag: "'.$etag.'"'); +header('Last-Modified: '.$modified); + +if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { + + $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])); + $cached_etag = str_replace(array('"', "-gzip"), array('', ''), + stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); + + if (($cached_modified == $modified) && ($cached_etag == $etag)) { + header('HTTP/1.1 304 Not Modified'); + exit(); + } +} +echo $stylecss;