-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[core] Implemented MemcachedCache #1000
Conversation
Nice work 🥇 Just to be sure, Memcached is some sort of external service?
Good point, this clearly needs to be fixed. I've added the Code-Investigation-Needed label for that reason.
Out of curiosity, would compressing files do any good? |
It will slow down bridge instance itself 'cos of decompressing and compressing. Feed items cached data in my instance was less than 5 mb, AFAIK |
I'm gonna merge #1002 in a minute, which breaks this PR because the code from Would it be okay for you to merge this PR without changes to |
No problem. I will fix this PR |
Thanks, support for custom cache names will follow in a minute... |
This commit adds support for a new parameter which specifies the type of cache to use for caching. It is specified in config.ini.php: [cache] type = "..." Currently only one type of cache is supported (see /caches). All uses of 'FileCache' were replaced by this configuration option. Note: Caching currently depends on files and folders (due to FileCache). Experience may vary depending on the selected cache type. For now always check if FileCache is working before testing alternative types. References #1000
Adding ; Defines the cache type used by RSS-Bridge
; "file" = FileCache (default)
; "memcache" = MemcacheCache
type = "memcache" to |
Fixed with: diff --git a/lib/Cache.php b/lib/Cache.php
index 6826d4c..6c2943a 100644
--- a/lib/Cache.php
+++ b/lib/Cache.php
@@ -193,7 +193,7 @@ class Cache {
}
// Trim trailing 'Cache' if exists
- if(preg_match('/(.+)(?:Cache)/i', $name, $matches)) {
+ if(preg_match('/(.+)(?:Cache)$/i', $name, $matches)) {
$name = $matches[1];
}
|
I've added your fix to master. Hope it works now. Regarding Travis, here is a rather new discussion regarding memcached support which could be of help: https://travis-ci.community/t/unable-to-load-dynamic-library-memcached-so/2232 |
Can this be merged? |
Please test if this still works on current master. #1060 introduced a few changes. |
It does not. I will make changes for it to work. |
Looks fine on first minutes on my instance. I will comment here tomorrow morning (YEKT) if everything is fine. |
Works fine. It can be merged now |
Thanks for the hard work ! |
This commit adds support for a new parameter which specifies the type of cache to use for caching. It is specified in config.ini.php: [cache] type = "..." Currently only one type of cache is supported (see /caches). All uses of 'FileCache' were replaced by this configuration option. Note: Caching currently depends on files and folders (due to FileCache). Experience may vary depending on the selected cache type. For now always check if FileCache is working before testing alternative types. References RSS-Bridge#1000
* [core] Implemented MemcachedCache
In my bridge instance to reduce usage of file system, MemcachedCache was implemented to use memcached server as feed items cache.
To turn it on I made hardcode edit:
It would be cool, if user could use some other cache just by editing config. But in current implementation, there is no such config. So for this, we need next config items:
Here we discuss, how to implement MemcachedCache to bridge instance in normal way