Loading...

使用.htaccess關閉特定文件的緩存

Temperature: 0 °C

Mark ChangMark Chang
author_tools

以特定檔案為例

<Files page.php>
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</Files>

或者以特定的文件選擇為目標
<filesMatch "\.(html|htm|js|css|php)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</filesMatch>

反之若是要針對特定文件或檔案去做cache也是可以用同樣的方式。

以上紀錄~
 

More chapters / Next article: 如何緩存靜態資源使用HTTP緩存

https://innstory.com/story-使用htaccess關閉特定文件的緩存-2470
apache

Prev
 分享_首度載人試飛成功!日本新創SkyDrive拚2023年造出飛天計程車、30年後人人可搭|數位時代

Next
如何緩存靜態資源使用HTTP緩存 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

js判斷字母是否為大小寫

js判斷字母是否為大小寫

使用JS來判斷字串裡是否含有大寫字母或小寫字母。 //判斷是否含有大寫字母 function chk...

使用JavaScript的split函式完成字串切割

使用JavaScript的s...

使用JavaScript的split 函式可以用來切割字串。 根據設定的切割點執行切開的動作。 以下...

改變input placeholder 字體顏色

改變input placeh...

colorphoto55 通常我們會使用 placeholder 來作為欄位提醒文字~ 通常 pla...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format