php压缩多个CSS为一个css的代码并缓存
2018-09-26 20:08
阅读:489
复制代码 代码如下:
<?php
/*
Compress multiple CSS files into one and cache for an hour.
Use the same code for Javascript, but replace below text/css with text/javascript and of course make sure you include .js files instead of .css ones.
*/
ob_start(ob_gzhandler);
header(Content-type: text/css; charset: UTF-8);
header(Expires: .gmdate(D, d M Y H:i:s, time() + 60*60). GMT);
include(somefile.css);
echo \n\n;
include(anotherfile.css);
echo \n\n;
ob_flush();
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:php压缩多个CSS为一个css的代码并缓存
文章链接:http://soscw.com/index.php/essay/17881.html
文章标题:php压缩多个CSS为一个css的代码并缓存
文章链接:http://soscw.com/index.php/essay/17881.html
评论
亲,登录后才可以留言!