Permalink
Browse files

Caching directives

PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with: 

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
  • Loading branch information...
1 parent 361edb0 commit 285f657af8417f179db55b24e3ddbd7d310a2a1d @mrelkabany mrelkabany committed Jun 12, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 plugins/fileManager/handlers/PHP/common.php
@@ -112,6 +112,7 @@ function json_response ($json, $exit = true) {
$json = json_encode($json);
}
header("Content-type: application/json; charset=utf-8");
+ header("Cache-Control: no-cache, must-revalidate");
echo $json;
if($exit) {

0 comments on commit 285f657

Please sign in to comment.