PluginProbe
Autoptimize / 0.8
Autoptimize v0.8
2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 All 107 releases
autoptimize / config / default.php

default.php in Autoptimize 0.8, at config/default.php

38 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php exit;
2 // Determine supported compression method
3 $gzip = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
4 $deflate = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate');
5
6 // Determine used compression method
7 $encoding = $gzip ? 'gzip' : ($deflate ? 'deflate' : 'none');
8
9 // Check for buggy versions of Internet Explorer
10 if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Opera') &&
11 preg_match('/^Mozilla\/4\.0 \(compatible; MSIE ([0-9]\.[0-9])/i', $_SERVER['HTTP_USER_AGENT'], $matches))
12 {
13 $version = floatval($matches[1]);
14
15 if ($version < 6)
16 $encoding = 'none';
17
18 if ($version == 6 && !strstr($_SERVER['HTTP_USER_AGENT'], 'EV1'))
19 $encoding = 'none';
20 }
21
22 //Get data
23 $contents = file_get_contents(__FILE__.'.'.$encoding);
24
25 if (isset($encoding) && $encoding != 'none')
26 {
27 // Send compressed contents
28 header('Content-Encoding: '.$encoding);
29 header('Content-Length: '.strlen($contents));
30 }
31 header('Vary: Accept-Encoding');
32
33 header('Content-type: %%CONTENT%%; charset=utf-8');
34 header('Cache-Control: max-age=315360000, public, must-revalidate');
35 header('Expires: '.gmdate('D, d M Y H:i:s', time() + 315360000).' GMT'); //10 years
36
37 echo $contents;
38