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

Use Rails cache store in Front Cache plugin #662

Merged
merged 1 commit into from
Jul 3, 2017
Merged

Use Rails cache store in Front Cache plugin #662

merged 1 commit into from
Jul 3, 2017

Conversation

brian-kephart
Copy link
Collaborator

What it does:

  • Uses the Rails cache store for the Front Cache plugin instead of manually managing files. This benefits users of distributed cache stores like Memcached or Redis.
  • Adds a checkbox to settings to allow preserving the cache on restart. This benefits users of Heroku and others using ephemeral file systems.
  • Preserves previous behavior (for the most part). The default cache store in Rails is :file_store, so anyone who doesn't configure their Rails cache should experience similar performance to the previous implementation. Also, the cache will still be cleaned on restart unless the new option in settings is selected.
  • Addresses Feature Request: Memcached/Redis support #609.
  • Bumps plugin version to 0.2.

What it doesn't do:

  • Translate the new settings option (I don't have the language skills).
  • Allow for clearing the Front Cache without clearing the whole Rails cache. I couldn't find a way of doing this that would support all common caching methods.

@owen2345
Copy link
Owner

Initially the plugin was like your idea using rails.cache, but I had problems to delete cache when site has many languages. Sample: delete front cache after a specific post is updated or delete caches for current site.
I found delete_matched but it doesn't support for memcached.

@brian-kephart
Copy link
Collaborator Author

Right, delete_matched doesn't have wide enough support. It's too bad, since I would like to use it.

I'm not sure what you're concerned about though, in regard to deleting the cache. I didn't see any code that called front_cache_destroy or anything else to delete a single item, so I thought deleting the whole cache would be adequate to replace the current plugin operation. The cache is cleared in all the same circumstances using this PR as in the existing code. Are you concerned that deleting the cache would delete it for all sites, not just current_site? Can you help me understand the problem?

@owen2345 owen2345 merged commit b5b7289 into owen2345:master Jul 3, 2017
@brian-kephart brian-kephart deleted the use_rails_cache branch July 11, 2017 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants