|
<?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技術(shù):php壓縮多個(gè)CSS為一個(gè)css的代碼并緩存,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。