You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
imagine you like to write a new cache implementation based on the documentation in the wiki, like I did in PR #1035. It basically describes the functions loadData, saveData, getTime and purgeCache that are defined in the CacheInterface class. So, you know how to save, load, delete and get the age of your data.
However, following the key-value storage principle, there's something missing: a key or token to identify your data. Looking at the FileCache implementation, there are two functions that get called first: setPath($path) and setParameters(array $param). They are undocumented and declared with file based caching in mind.
Basically, setPath gets the absolute path where to store the particular data entry. Not sure if this is always the same, probably it's not. I consider this to be some kind of scope. And setParameters appears to get the parameters of the feed. So, this is the key the data is related to.
I think this needs some clarification.
The text was updated successfully, but these errors were encountered:
You are right, CacheInterface was originally designed with FileCache in mind (this is actually still the same implementation as in the early days of RSS-Bridge). That is also the reason why documentation and interface are very basic. Cache types like SQLite (#1035) and Memcached (#1000) have different requirements which need to be taken into consideration.
Allow cache to specify requirements that are checked before execution (i.e. 'sqlite3' or 'memcache(d)') (see f450b2e for reference)
Replace setPath by i.e. setHeader to specify which kind of cache to use (i.e. 'feed' for caching the actual feeds, 'page' for caching replies from servers, etc...). For SQLite that could mean different tables, folders for FileCache, servers for Memcached, etc....
You and @em92 can probably name more requirements. Please don't hesitate to open PRs to address these changes.
Hi there,
imagine you like to write a new cache implementation based on the documentation in the wiki, like I did in PR #1035. It basically describes the functions
loadData
,saveData
,getTime
andpurgeCache
that are defined in theCacheInterface
class. So, you know how to save, load, delete and get the age of your data.However, following the key-value storage principle, there's something missing: a key or token to identify your data. Looking at the
FileCache
implementation, there are two functions that get called first:setPath($path)
andsetParameters(array $param)
. They are undocumented and declared with file based caching in mind.Basically,
setPath
gets the absolute path where to store the particular data entry. Not sure if this is always the same, probably it's not. I consider this to be some kind of scope. AndsetParameters
appears to get the parameters of the feed. So, this is the key the data is related to.I think this needs some clarification.
The text was updated successfully, but these errors were encountered: