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