Skip to content

Create PSR-16 cache#1

Draft
Art4 wants to merge 10 commits intoallow-simplepie-updates-with-composerfrom
create-psr-16-cache
Draft

Create PSR-16 cache#1
Art4 wants to merge 10 commits intoallow-simplepie-updates-with-composerfrom
create-psr-16-cache

Conversation

@Art4
Copy link
Owner

@Art4 Art4 commented Aug 24, 2024

Refs FreshRSS/simplepie#11

This PR is a poc for a PSR-16 cache implementation using in SimplePie 1.8.0, based on PR FreshRSS#4374

Changes proposed in this pull request:

  • Allows better cache optimizations with SimplePie 1.8.0
  • Makes most changes in the cache class of the SimplePie fork not necessary.

How to test the feature manually:

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (optional if too hard)
  • documentation updated

Additional information can be found in the documentation.

@Art4
Copy link
Owner Author

Art4 commented Aug 24, 2024

@Alkarex I have not tested the code so far, but it should give you a basic idea how the new PSR-16 cache service could work. This cache could also be used on other places in FreshRSS where things have to be cached.

For every cache value there will be two files:

  1. <sha1>.spc for the serialized value
  2. <sha1>.spc.meta for meta data like expiration_time as JSON

It is also possible to store the value and meta data in the same file, or even use mtime() and touch() on the cache file. The meta data could also contain more information for a better optimizations like the hashs from FreshRSS/simplepie#11

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.

1 participant