2013-07-24 33 views
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文件,但沒有任何更改。我正在用盡想法。

回答

0

請檢查plugin assets好像調度程序處理的所有插件靜態文件都是錯誤標題的原因。因此,儘量領導官方文件並創建符號鏈接