Better place to check caching headers
This commit is contained in:
parent
ab18a0bfe8
commit
5d72681d10
|
@ -289,12 +289,12 @@ class OC{
|
||||||
$appswebroot = (string) OC::$APPSWEBROOT;
|
$appswebroot = (string) OC::$APPSWEBROOT;
|
||||||
$webroot = (string) OC::$WEBROOT;
|
$webroot = (string) OC::$WEBROOT;
|
||||||
$filepath = OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE;
|
$filepath = OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE;
|
||||||
$cssfile = file_get_contents($filepath);
|
|
||||||
$cssfile = str_replace('%appswebroot%', $appswebroot, $cssfile);
|
|
||||||
$cssfile = str_replace('%webroot%', $webroot, $cssfile);
|
|
||||||
header('Content-Type: text/css');
|
header('Content-Type: text/css');
|
||||||
OC_Response::enableCaching();
|
OC_Response::enableCaching();
|
||||||
OC_Response::setLastModifiedHeader(filemtime($filepath));
|
OC_Response::setLastModifiedHeader(filemtime($filepath));
|
||||||
|
$cssfile = file_get_contents($filepath);
|
||||||
|
$cssfile = str_replace('%appswebroot%', $appswebroot, $cssfile);
|
||||||
|
$cssfile = str_replace('%webroot%', $webroot, $cssfile);
|
||||||
OC_Response::setETagHeader(md5($cssfile));
|
OC_Response::setETagHeader(md5($cssfile));
|
||||||
header('Content-Length: '.strlen($cssfile));
|
header('Content-Length: '.strlen($cssfile));
|
||||||
echo $cssfile;
|
echo $cssfile;
|
||||||
|
|
Loading…
Reference in New Issue