久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 Cakephp 中完全禁用緩存?

How do I completely disable caching in Cakephp?(如何在 Cakephp 中完全禁用緩存?)
本文介紹了如何在 Cakephp 中完全禁用緩存?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

所以我在我的 Cakephp 應(yīng)用程序中打開了緩存閘門,現(xiàn)在我想關(guān)閉它們......

So I opened the cache floodgates in my Cakephp app and now I want to close them...

我已經(jīng)做了我能做的幾乎所有事情:刪除 tmp 文件夾中的所有文件(但不是文件夾),在我的應(yīng)用程序的 core.php 文件中打開Cache.disable",嘗試清除緩存在一些帶有 clearCache() 和 Cache::clear() 的控制器中(但我懷疑這不起作用,因?yàn)樗鼪]有加載控制器——由于緩存).

I've done pretty much everything I can: delete all files in the tmp folder (but not the folders), turned 'Cache.disable' on in the core.php file in my app, have tried clearing the cache from within some controllers with clearCache() and Cache::clear() (but I suspect this doesn't work because it's not loading the controller -- due to caching).

我?guī)缀跤行У赝V沽宋业拈_發(fā)過程,因?yàn)榫彺娌粫?huì)關(guān)閉.任何人都有一些我可以嘗試的想法?我開始認(rèn)為它可能在瀏覽器中,也可能在我的托管服務(wù)中,但可能只是 Cakephp 惹惱了我.

I've pretty much effectively halted my development process just because caching won't turn off. Anyone have some ideas that I could try? I'm starting to think it may be within the browser or maybe my hosting service, but it's probably just Cakephp messing with me.

推薦答案

要排除瀏覽器緩存作為根本原因,您可以嘗試添加以下幾行:

To rule out browser caching as the root cause, you might try adding the following lines:

header('Cache-Control: no-store, private, no-cache, must-revalidate');                  // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0, max-stale = 0', false);    // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');                                       // Date in the past  
header('Expires: 0', false); 
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Pragma: no-cache');

根據(jù)我的經(jīng)驗(yàn),所有這些緩存破壞 HTTP 標(biāo)頭的組合適用于所有瀏覽器,并且還繞過了一些非常激進(jìn)的緩存代理.

The combination of all these cache-busting HTTP headers has, in my experience, worked in all browsers, and has got around some very aggressive caching proxies as well.

這篇關(guān)于如何在 Cakephp 中完全禁用緩存?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個(gè)表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動(dòng)填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 国产精品久久久久免费 | 男人天堂99| 一区二区三区四区视频 | 亚洲天堂一区二区 | 国产欧美一区二区三区另类精品 | 日本高清不卡视频 | 国产探花在线精品一区二区 | 中文字幕亚洲欧美日韩在线不卡 | 欧美精品日韩精品国产精品 | 精品国产欧美日韩不卡在线观看 | 精品亚洲一区二区三区 | h片免费看 | 国产精品a久久久久 | 久久久久久av| 免费看91 | 黄色av大片 | 国产乱码精品一区二区三区中文 | 91精品国产色综合久久不卡蜜臀 | 日韩精品久久一区二区三区 | 成人不卡 | 九色一区| 97中文视频 | 中文字幕一区二区三区在线视频 | 在线不卡视频 | 国产.com| 国产婷婷色一区二区三区 | 青青久视频 | 在线播放国产一区二区三区 | 欧美另类视频在线 | 91国内外精品自在线播放 | 欧美性一区二区三区 | 国产高潮好爽受不了了夜夜做 | 国产高清一区二区 | 欧美综合一区二区三区 | 成人影 | 久干网| 国产一级片 | 九九热视频这里只有精品 | 久久久av一区 | 亚洲字幕在线观看 | 日韩精品一区二区三区中文字幕 |