cache JS-File to reduce response-time

no message
This commit is contained in:
tinect
2019-10-19 23:40:19 +02:00
parent 476502a8b0
commit 3f6a2fc7fa
5 changed files with 58 additions and 4 deletions

View File

@@ -30,7 +30,14 @@
$css_minifier->add('/web/css/site/index.css');
}
?>
<style><?=$css_minifier->minify();?></style>
<style><?php
$CSSPath = '/tmp/' . $css_minifier->getDataHash() . '.css';
if(file_exists($CSSPath)) {
echo file_get_contents($CSSPath);
} else {
echo $css_minifier->minify($CSSPath);
}
?></style>
<?php if (strtolower(trim($DEFAULT_THEME)) != "lumen"): ?>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/<?= strtolower(trim($DEFAULT_THEME)); ?>/bootstrap.min.css">
<?php endif; ?>