Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15476674
D15807.id38081.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15807.id38081.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 8, 8:33 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704045
Default Alt Text
D15807.id38081.diff (1 KB)
Attached To
Mode
D15807: Improve cache behaviors for font files and other nonstandard resource types
Attached
Detach File
Event Timeline
Log In to Comment