X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Ftheme%2Fvier%2Fstyle.php;h=3d3c776745de4c86a02527d334a0eab9a811b61f;hb=c825cc8d0d61386cb00b6310fc4ea46c4354460d;hp=72731a9bebc9843d3c7949c7a53e7a9abfe16593;hpb=5fe357ee75221a155aa1c535ba272f8441053e5a;p=friendica.git diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php index 72731a9beb..3d3c776745 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) AND ($cached_etag == $etag)) { + header('HTTP/1.1 304 Not Modified'); + exit(); + } +} echo $stylecss;