0
我開發了一個基於CakePHP的非常簡單的Web應用程序。我目前正在運行一些速度測試,爲了優化性能,我使用.htaccess打開了一些Apache模塊,比如mod_deflate。不過,我正在爲即將到期的標題掙扎。 我已經發現一對夫婦的解決方案,這是我目前的htaccess:CakePHP Expiring Headers(插件)
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 1 year"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/release
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
使用YSlow的,我可以看到一些資產的擁有權價值,但有些JS/CSS文件來形式的插件(/應用/插件/ X/webroot)不會更改該值。
我也嘗試在插件文件夾中添加htaccess文件,但沒有任何更改。我正在用盡想法。