Script usage:
- Requires php5 and above
- If the program cannot find a local file, it will go to the specified cdn to find the file with the same name.
- The program will automatically escape the -min file as a source file, so it is agreed that the -min file and the original file must appear in pairs
- Need to define the $YOUR_CDN variable in combo.php and minify.php
- If you just merge and compress local files, you don’t have to reset the $YOUR_CDN variable
- cb.php is provided here to simulate the development environment of tbcdn. The configuration of apache is in cb.php
header("Expires: " . date("D, j M Y H:i:s", strtotime("now + 10 years")) ." GMT");
//Text processing
header($header[$type]);// File type
if(preg_match('/js|css/',$type)){
$result = join("",$files);
}else{
//Non-text processing
$result = join( "",$files[0]);
}
cache(md5($result));//etag, is it redundant to process Etag?
echo $result;
?>
Copy code
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn