Skip to content
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

Hardcoded cache $prefix makes it impossible to find keys from different hosts #951

Closed
GhaziTriki opened this issue Jul 31, 2016 · 3 comments

Comments

@GhaziTriki
Copy link

GhaziTriki commented Jul 31, 2016

Hello,

We have following configuration. We have an F3 application that have pseudo-CDN feature under /cdn/*. We have added a redirection in .htaccess from /cdn/* to cdn.domain.com/*. It results in different cache prefixes and keys added in main domain cannot be found in subdomain. And it does not work because of the following line.

https://github.com/bcosca/fatfree-core/blob/64976a57729024657cd7ee4cc01ea7f74d5b0e43/base.php#L2462

A good example, one of our keys is avatar.user.60.90x90
Cache prefix is $this->prefix . $key;
In cdn.domain.com : $this->prefix = 'h6qqa2jvtoez';
In domain.com : $this->prefix = '3awbd3dh8n400';

Cache $prefix should be configurable and should not be hardcoded.

@ikkez
Copy link
Collaborator

ikkez commented Aug 6, 2016

Hi. The used application specific hash is now globally configurable with the new $f3->SEED var.

@ikkez ikkez closed this as completed Aug 6, 2016
@ikkez ikkez changed the title Hardcoded cache $prefix makes impossible to find key with a subodmain redirection Hardcoded cache $prefix makes it impossible to find keys from different hosts Aug 6, 2016
@GhaziTriki
Copy link
Author

Hi, good idea for the implementation. It should be added to the official documentation.

@ptdev
Copy link
Contributor

ptdev commented Aug 30, 2016

Hey, just came across a similar issue and had to set this variable.

It should be stated that one should set the SEED variable before setting the CACHE variable, otherwise it won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants