海蘭, 我有我的Drupal網站,我想緩存圖像的家庭,但如果在htaccess的寫:只緩存一個帶有「.htaccess」而不是所有圖像(.png)的圖像(.png)?
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresByType image/png "access 1 year"
</IfModule>
## EXPIRES CACHING ##
這將是緩存中的所有文件(巴紐)...
我想只緩存一個image.png;所以我問你是否有一種方法緩存只有一個規則在「.htaccess」中的一個元素? 是可能的?
謝謝:))
再見來自意大利)
編輯:
可以寫入也:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
<FilesMatch 'image\.png$ sites/all/themess/mysubtheme/images/sm.png'>
ExpiresByType image/png "access 1 year"
</FilesMatch>
</IfModule>
## EXPIRES CACHING ##
???
,最後,如果我有兩個圖像(.PNG)(被sm.pngËsmall.png)我寫:
## EXPIRES CACHING ##
<IfModule mod_expires.c>
<FilesMatch 'image\.png$ sites/all/themess/mysubtheme/images/sm.png'>
ExpiresByType image/png "access 1 year"
</FilesMatch>
<FilesMatch 'image\.png$ sites/all/themess/mysubtheme/images/small.png'>
ExpiresByType image/png "access 1 year"
</FilesMatch>
</IfModule>
## EXPIRES CACHING ##
2°EDIT:
我有寫這樣的:
<FilesMatch '(image|small)\.png$'>
ExpiresByType image/png "access 1 year"
</FilesMatch>
,但如果我使用「頁面速度測試谷歌」或「Pingdom的工具」,而不是結果圖像small.png緩存 哪裏是電子恐怖?也許我需要插入圖像的網址?
沒有任何關於該問:/ – Borja