Loading...

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

Temperature: 0 °C

Mark ChangMark Chang
author_tools
配置服務器以返回Cache-ControlHTTP響應標頭:
Cache-Control: max-age=31536000

max-age指令告訴瀏覽器應該以秒為單位緩存資源多長時間。

上例將持續時間設置為31536000,對應於1年:60秒×60分鐘×24小時×365天= 31536000秒。

以上紀錄
 
https://innstory.com/story-如何緩存靜態資源使用HTTP緩存-2471

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

Next
PHP_運算次方pow_函数 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

Linux vi修改文件時遇到:E212無法打開文件進行寫入

Linux vi修改文件時遇到:E212無法打開文件進行寫入

執行修改 vi /etc/ssh/sshdconfig 使用wq(儲存後離開)或者是...

CSS3濾鏡Filter的十種特效

CSS3濾鏡Filter的十種特效

CSS 濾鏡效果 Filters 主要是運用在圖片上,以實現一些特效。...

.htaccess與RewriteEngine一起使用時500內部服務器錯誤

.htaccess與RewriteEngine一起使用時500內部服務器錯誤

在某些情況下,可能未加載apache中的modrewrite模塊。 這時只需要執行以下...

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