matomo-org / component-cache Goto Github PK
View Code? Open in Web Editor NEWPHP caching library based on Doctrine cache
Home Page: http://piwik.org
License: GNU Lesser General Public License v3.0
PHP caching library based on Doctrine cache
Home Page: http://piwik.org
License: GNU Lesser General Public License v3.0
The set lifeTime will be used in case there is none provided in the save
method. Allows you for example to create different cache instances with different default lifetimes
For example by developing a decorator.
This will bring a performance improvement as we do for each fetch
, contains
, save
run a preg_match
https://github.com/piwik/component-cache/blob/master/src/Lazy.php#L119 and a completeCacheKey
which is expensive when executed a million of times (which we do) eg in BulkTracking or QueuedTracking. Also via Archiving etc.
Allows to easily switch the libraries
To make transient cache even faster we should no longer use the ArrayCache
backend but basically extend ArrayCache
or reimplement everything in that class so that we do only call php built-in functions within that class. We call those methods sometimes a million times and we have a load of overhead just by doing things like parent::doContains()
etc.
doDelete
returns true when cache file did not exist.doDelete
returns false when cache file did not exist.Proposal: all backends could simply return true
when the cache file did not exist.
This was changed in doctrine/cache in: doctrine/cache@17d710d#diff-06cf1d6e08d58ed82a5ccb0b0d21100dR142
Reported in matomo-org/matomo#6873
Created cache looked like this:
),
);Piwik\\Plugin\\ViewDataTable' =>
array (
Notice how the variable ends and then there is an invalid string. It looks like the file got written to, and then partially written to. Race condition because of file_put_contents
used in doctrine cache
See matomo-org/matomo#15067 (comment)
Instead of delete it should call the del
method I reckon. For this we would probably need to update the doctrine dependency see https://github.com/doctrine/cache/blob/v1.8.1/lib/Doctrine/Common/Cache/RedisCache.php#L126
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.