Permalink
Browse files

Merge pull request #1217 from DaSourcerer/http-caching

CHttpCacheFilter failed to comply with RFC 2616
  • Loading branch information...
2 parents 05441ab + 2d738d9 commit acfca6e6813b3b470ac5de13dd34cc76fe3981b2 @qiangxue qiangxue committed Aug 13, 2012
Showing with 4 additions and 3 deletions.
  1. +1 −0 CHANGELOG
  2. +3 −3 framework/web/filters/CHttpCacheFilter.php
View
@@ -14,6 +14,7 @@ Version 1.1.12 work in progress
- Bug #1094: CGridView with enabled history used to clear page title in case sorting or paging performed (Opera and Firefox only) (resurtm)
- Bug #1109: Fixed "js:" encoding BC-break in CHtml::ajax() and related methods introduced in 1.1.11 (samdark)
- Bug #1120: Fixed duplicate events processing in CGridView when ENTER was pressed for filtering (mdomba)
+- Bug #1192: CHttpCacheFilter failed to comply with RFC 2616, section 10.3.5 (DaSourcerer)
- Enh #243: CWebService is now able to deal with the customized WSDL generator classes, was hardcoded to the CWsdlGenerator before, added CWebService::$generatorConfig property (resurtm)
- Enh #636: CManyManyRelation now parses foreign key for the junction table data internally, and provide public interface to access it (klimov-paul)
- Chg #1099: Changed connectionId dropdown to sticky text field in Gii model generator (mdomba)
@@ -64,6 +64,9 @@ public function preFilter($filterChain)
if($etag===false&&$lastModified===false)
return true;
+ if($etag)
+ header('ETag: '.$etag);
+
if(isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])&&isset($_SERVER['HTTP_IF_NONE_MATCH']))
{
if($this->checkLastModified($lastModified)&&$this->checkEtag($etag))
@@ -96,9 +99,6 @@ public function preFilter($filterChain)
if($lastModified)
header('Last-Modified: '.date('r', $lastModified));
- if($etag)
- header('ETag: '.$etag);
-
$this->sendCacheControlHeader();
return true;
}

0 comments on commit acfca6e

Please sign in to comment.