From 1674e9d9368ce2a5bc3c7e09cbbedfb2512b5111 Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 19 Oct 2007 08:57:53 +0000 Subject: [PATCH] Closes #2249, enable Browser caching for js & css files in vendors git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5800 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/dispatcher.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index daea530b9..30a0b01cf 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -628,7 +628,12 @@ class Dispatcher extends Object { if (in_array($requestPath[0], array_keys($folders))) { if (file_exists(VENDORS . join(DS, $requestPath))) { + $fileModified = filemtime(VENDORS . join(DS, $requestPath)); + header("Date: " . date("D, j M Y G:i:s ", $fileModified) . 'GMT'); header('Content-type: ' . $folders[$requestPath[0]]); + header("Expires: " . gmdate("D, j M Y H:i:s", time() + DAY) . " GMT"); + header("Cache-Control: cache"); + header("Pragma: cache"); include (VENDORS . join(DS, $requestPath)); exit(); }