| @@ -58,9 +58,9 @@ | ||
| 58 | 58 | // Write code to cache without doing anything else |
| 59 | 59 | file_put_contents($this->cachedir.$this->filename,$code, LOCK_EX); |
| 60 | 60 | if (apply_filters('autoptimize_filter_cache_create_static_gzip', false)) { |
| 61 | 61 | // Create an additional cached gzip file |
| 62 | - file_put_contents($this->cachedir.$this->filename.'.gz', gzencode($code,9,FORCE_GZIP), LOCK_EX); | |
| 62 | + file_put_contents($this->cachedir.$this->filename.'.gzip',gzencode($code,9,FORCE_GZIP), LOCK_EX); | |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| @@ -103,15 +103,8 @@ | ||
| 103 | 103 | // try to purge caching plugins cache-files? |
| 104 | 104 | include_once(AUTOPTIMIZE_PLUGIN_DIR.'classlesses/autoptimizePageCacheFlush.php'); |
| 105 | 105 | add_action("autoptimize_action_cachepurged","autoptimize_flush_pagecache",10,0); |
| 106 | 106 | |
| 107 | - // warm cache (part of speedupper)? | |
| 108 | - if ( apply_filters('autoptimize_filter_speedupper', true) ) { | |
| 109 | - $warmCacheUrl = site_url()."/?ao_speedup_cachebuster=".rand(1,100000); | |
| 110 | - $warmCache = @wp_remote_get($warmCacheUrl); | |
| 111 | - unset($warmCache); | |
| 112 | - } | |
| 113 | - | |
| 114 | 107 | return true; |
| 115 | 108 | } |
| 116 | 109 | |
| 117 | 110 | static function stats() { |
| @@ -148,9 +141,9 @@ | ||
| 148 | 141 | } |
| 149 | 142 | } |
| 150 | 143 | $AOstats=array($count,$size,time()); |
| 151 | 144 | if ($count>100) { |
| 152 | - set_transient( "autoptimize_stats", $AOstats, apply_filters( 'autoptimize_filter_cache_statsexpiry', HOUR_IN_SECONDS ) ); | |
| 145 | + set_transient("autoptimize_stats",$AOstats,HOUR_IN_SECONDS); | |
| 153 | 146 | } |
| 154 | 147 | } |
| 155 | 148 | // print the number of instances |
| 156 | 149 | return $AOstats; |
| @@ -185,17 +178,18 @@ | ||
| 185 | 178 | $htaccess_tmpl=WP_CONTENT_DIR."/AO_htaccess_tmpl"; |
| 186 | 179 | if (is_file($htaccess_tmpl)) { |
| 187 | 180 | $htAccessContent=file_get_contents($htaccess_tmpl); |
| 188 | 181 | } else if (is_multisite() || AUTOPTIMIZE_CACHE_NOGZIP == false) { |
| 189 | - $htAccessContent='<IfModule mod_expires.c> | |
| 182 | + $htAccessContent='<IfModule mod_headers.c> | |
| 183 | + Header set Vary "Accept-Encoding" | |
| 184 | + Header set Cache-Control "max-age=10672000, must-revalidate" | |
| 185 | +</IfModule> | |
| 186 | +<IfModule mod_expires.c> | |
| 190 | 187 | ExpiresActive On |
| 191 | 188 | ExpiresByType text/css A30672000 |
| 192 | 189 | ExpiresByType text/javascript A30672000 |
| 193 | 190 | ExpiresByType application/javascript A30672000 |
| 194 | 191 | </IfModule> |
| 195 | -<IfModule mod_headers.c> | |
| 196 | - Header append Cache-Control "public, immutable" | |
| 197 | -</IfModule> | |
| 198 | 192 | <IfModule mod_deflate.c> |
| 199 | 193 | <FilesMatch "\.(js|css)$"> |
| 200 | 194 | SetOutputFilter DEFLATE |
| 201 | 195 | </FilesMatch> |
| @@ -211,16 +205,17 @@ | ||
| 211 | 205 | Allow from all |
| 212 | 206 | </Files> |
| 213 | 207 | </IfModule>'; |
| 214 | 208 | } else { |
| 215 | - $htAccessContent='<IfModule mod_expires.c> | |
| 209 | + $htAccessContent='<IfModule mod_headers.c> | |
| 210 | + Header set Vary "Accept-Encoding" | |
| 211 | + Header set Cache-Control "max-age=10672000, must-revalidate" | |
| 212 | +</IfModule> | |
| 213 | +<IfModule mod_expires.c> | |
| 216 | 214 | ExpiresActive On |
| 217 | 215 | ExpiresByType text/css A30672000 |
| 218 | 216 | ExpiresByType text/javascript A30672000 |
| 219 | 217 | ExpiresByType application/javascript A30672000 |
| 220 | -</IfModule> | |
| 221 | -<IfModule mod_headers.c> | |
| 222 | - Header append Cache-Control "public, immutable" | |
| 223 | 218 | </IfModule> |
| 224 | 219 | <IfModule mod_deflate.c> |
| 225 | 220 | <FilesMatch "\.(js|css)$"> |
| 226 | 221 | SetOutputFilter DEFLATE |