1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

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
This commit is contained in:
epriestley 2015-06-01 09:04:22 -07:00
parent a55c4a651e
commit 7a9174fa21

View file

@ -165,7 +165,7 @@ abstract class CelerityResourceController extends PhabricatorController {
}
private function getCacheKey($path) {
return 'celerity:'.$path;
return 'celerity:'.PhabricatorHash::digestToLength($path, 64);
}
}