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

Allow memcache and redis to be automatically selected as cache method when present #867

Closed
Sommerregen opened this issue May 31, 2016 · 8 comments
Labels

Comments

@Sommerregen
Copy link
Contributor

Sommerregen commented May 31, 2016

  1. Although somewhat implemented, the auto select logic of the cache method doesn't select Memcache or Redis if present (see https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Cache.php#L139-L148). Obviously, some extension_loaded(...) checks are missing.
  2. Further, both Memcache or Redis can only be configured manually (https://github.com/getgrav/grav/blob/develop/system/src/Grav/Common/Cache.php#L172-187), but not via Admin plugin. I actually don't know, whether this issue should be addressed here; if required I'll open an issue on the Admin plugin tracker instead.
  3. APCu can not be selected as a cache method option.
@rhukster
Copy link
Member

it's the very need of these two cache providers to require options to be configured, which is why they are not included in the auto selection process. With invalid settings, this would just cause your site to fail, and you wouldn't really know why.

Better to manually change these settings, and then set the cache to use this provider explicitly.

@Sommerregen
Copy link
Contributor Author

@rhukster Ok, this addresses point 1.)

My point 2. addresses the configuration options for these two cache providers. In the admin panel they can not be adjusted and not even be selected manually. What I mean is, there are no special cache specific options for both two cache providers:

cache_options

From the cache driver options there is no possibility to set Redis (my point 2) or APCu (my point 3) manually:

cache_driver

@flaviocopes
Copy link
Contributor

PR #887 addresses this issue. Adds Redis (and memcached) to the list, allows to configure them.

screen shot 2016-06-09 at 12 34 18

@Sommerregen
Copy link
Contributor Author

Sommerregen commented Jun 9, 2016

Thanks! :-) Was about to implement it by myself

EDIT: Wait, not merged yet.

@flaviocopes
Copy link
Contributor

Give it a try with memcache(d) if you want you use them, will test too

@Sommerregen
Copy link
Contributor Author

I have Grav running with Redis and one with Memcached under PHP7. It's working like a charm :-)

@flaviocopes
Copy link
Contributor

👍

@flaviocopes
Copy link
Contributor

merged

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

No branches or pull requests

3 participants