-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Make hashing of cache keys optional via a config value #672
Comments
READABLE_CACHE_KEYS fixes bcosca#672
You can also just use |
Of course. But that doesn't address when you do Base::instance->set('mykey', 'myvalue', 900) |
I agree with this changed, I had a similar problem using the hashed keys. On Thu, Aug 28, 2014 at 1:21 PM, Rafael Diaz-Tushman <
|
Hashed keys are necessary to prevent multiple applications sharing a common F3 folder from overwriting conflicting keys. |
I think it is wrong (sharing cache). IMHO I think F3 app should have a "name" like "myapp" and it should end up in a subfolder so that the apps do no share cache. Or there exist a setting for using a custom folder? |
F3 uses whatever cache backend is available or specified. Guess what happens when the cache backend is redis, memcache, wincache, xcache or PHP's apc/apcu and we use only plain identifiers? Debugging multiple apps would be horrible. |
Isn't that the purpose behind {prefix}? |
@bcosca, he only want the hashing of the key to become configurable, the prefix hash of each cache key, which is for identifying the app, stays untouched. |
To get shared Cache values, which is nice when you have asynchronous workers for example, you can do a quick edit in base.php around line 2237 in the Cache::load function. $this->prefix = $fw->get('SHARED_CACHE_KEYS') === true ? '' : $fw->hash($_SERVER['SERVER_NAME'] . $fw->get('BASE')); Then just set the SHARED_CACHE_KEYS variable: $f3->set('SHARED_CACHE_KEYS', true); |
I have a few views that allow me to view/invalidate user cache items, same as with opcache scripts, and although I can see the values of the items cached by f3, it's impossible to tell what the values correspond to since the key is hashed.
I end up seeing a long list of items with keys that look like this:
{prefix}.jsyuwgsbssg.var
{prefix}.plysmskighb.var
{prefix}.posdhjwhngb.var
etc
I'll make a pull request once I have this finished. Default f3 behavior won't change.
The text was updated successfully, but these errors were encountered: