angejia / pea Goto Github PK
View Code? Open in Web Editor NEWLaravel Eloquent Database Cache Layer
Laravel Eloquent Database Cache Layer
命中率?
如题
目前update只清除简单缓存数据,然后更新表版本,而没有清除对应的产生的复杂和普通缓存数据,这样导致下次复杂和普通查询时会根据新的版本号生成新的缓存,旧缓存永远不会被用到而且没有被清除,这样会导致redis里的数据越来越多,请问如何解决 @lvht 请问你们是怎么处理垃圾缓存数据的
[2015-12-02 17:11:24] test.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function needCache() on a non-object' in /code/angejia/feature-pea/vendor/angejia/pea/src/QueryBuilder.php:16
Angejia\Pea\QueryBuilder 继承 Illuminate\Database\Query\Builder ,覆盖了 get()
方法
如果命中了缓存,返回的是数组对象 stdClass Object
如果没有命中,返回的是 Illuminate\Support\Collection Object
不同类型的返回结果,对后续的处理是有问题的。
Illuminate\Database\Eloquent\Builder:: getModels() 就有使用 get()
的结果
$results = $this->query->get($columns)->all();
所以在命中的时候,就会报错
Call to a member function all() on array
先行谢过作者大大啦。。。
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.