From 7a9174fa21b79aca8894a8814fa60aa15c66dffe Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 1 Jun 2015 09:04:22 -0700 Subject: [PATCH] Digest resource cachekeys to maximum length Summary: Fixes T8372. We currently store the entire resource path in the cachekey; shorten it to a maximum of 64 characters. The key size is 128 and T8372 had an example of a 112-byte key which could run over 128 with a slightly-long cache namespace. Test Plan: - Not 100% sure this is the issue, but it seems likely. - Dumped the cachekey before and after the change. - Saw values like `celerity:/res/1432859262T/phabricator/e2460e8f/core.pkg.css-6eGjUCJORU3j` now. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8372 Differential Revision: https://secure.phabricator.com/D13095 --- .../celerity/controller/CelerityResourceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php index 717e20f9f9..d369981990 100644 --- a/src/applications/celerity/controller/CelerityResourceController.php +++ b/src/applications/celerity/controller/CelerityResourceController.php @@ -165,7 +165,7 @@ abstract class CelerityResourceController extends PhabricatorController { } private function getCacheKey($path) { - return 'celerity:'.$path; + return 'celerity:'.PhabricatorHash::digestToLength($path, 64); } }