Page MenuHomePhabricator

D15807.diff
No OneTemporary

D15807.diff

diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php
--- a/src/applications/celerity/controller/CelerityResourceController.php
+++ b/src/applications/celerity/controller/CelerityResourceController.php
@@ -50,8 +50,8 @@
// is not, refuse to cache this resource. This avoids poisoning caches
// and CDNs if we're getting a request for a new resource to an old node
// shortly after a push.
- $is_cacheable = ($hash === $expect_hash) &&
- $this->isCacheableResourceType($type);
+ $is_cacheable = ($hash === $expect_hash);
+ $is_locally_cacheable = $this->isLocallyCacheableResourceType($type);
if (AphrontRequest::getHTTPHeader('If-Modified-Since') && $is_cacheable) {
// Return a "304 Not Modified". We don't care about the value of this
// field since we never change what resource is served by a given URI.
@@ -60,7 +60,7 @@
$cache = null;
$data = null;
- if ($is_cacheable && !$dev_mode) {
+ if ($is_cacheable && $is_locally_cacheable && !$dev_mode) {
$cache = PhabricatorCaches::getImmutableCache();
$request_path = $this->getRequest()->getPath();
@@ -168,7 +168,7 @@
* @param string Resource type.
* @return bool True to enable caching.
*/
- private function isCacheableResourceType($type) {
+ private function isLocallyCacheableResourceType($type) {
$types = array(
'js' => true,
'css' => true,

File Metadata

Mime Type
text/plain
Expires
Wed, May 8, 11:33 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6273523
Default Alt Text
D15807.diff (1 KB)

Event Timeline