Comments (9)
Thanks for your question. Actually, you are right, invalidation on row level will not work for the example you provided. Lada Cache will automatically fall back to invalidation on table level. In order for this to be working, #16 must be solved first. Important is that this will not cause bugs, it will simply invalidate more data than actually required.
from lada-cache.
@spiritix thank you for your prompt reply. So, as I understand lada cache will work good caching everything including relation but every time a single-row change will be made to tables or in the relation table, lada cache will cache everything from scratch. Is that right?
At last, do you have any plans fixing #16 issue? Any eta? Can somehow people donate you to help on this?
from lada-cache.
Yes, exactly. Every time you perform a change on one of these three tables, all queries querying the corresponding table will be invalidated. That's basically how the built-in MySQL query cache works regarding invalidation.
I am planning to look at #16 and #46 within the next 1-2 months, but can't promise anything since I am pretty busy here at work. I really appreciate your intention to help me on this, however, it would help me the most if you could contribute to this project and create a pull request for this.
from lada-cache.
I guess it wont be difficult to support dynamic primary key but it would be trouble when the table has more than one id. In such cases it will require major code changes.
Btw, in my example if on the middle table companies_categories I will add a primary key id:
id (index key), id_company, id_category
would that solve the problem to allow row invalidation?
from lada-cache.
Yes, adding an 'id' column on pivot tables should solve the problem. I think for comprehensively solving this issue #46 should be done first, because this issue also requires data from Eloquent.
from lada-cache.
Hello again,
is there any way to know for specific calls if data retrieved by cache or database? Also, after an update or delete how can I know if the row invalidation worked or it recreated the whole cache?
from lada-cache.
Yes, there is :) You need to install the DebugBar for Laravel, then there will be a 'Lada' tab which shows all actions done by the cache. Also, you will see if a query actually gets cached or not since cached queries disappear from the queries tab. https://github.com/barryvdh/laravel-debugbar
from lada-cache.
I am not using debugbar, I switched to clockwork due to the fact that takes spaces from my app, while clockwork installs on chrome inspector. I already reinstalled it and I can see the lada tab with all information. But I didn't tested on row invalidation, that info would be also included on that tab?
from lada-cache.
The information is included but not very obvious. It will tell you which tags have been invalidated. Therefore, first of all, you need to check which tags your query has. And from the name of the tags, it's also apparent if a row-level invalidation was executed or not.
from lada-cache.
Related Issues (20)
- Support for Laravel 8 HOT 2
- PHP 8.0 error call_user_func_array 🐛 HOT 1
- Laravel 6 and lada-cache 4.0.2 problem HOT 3
- Too few arguments HOT 5
- withCount Issue HOT 4
- Spatie permission used with Lada-cache HOT 1
- Use many unions and use paginate errors HOT 1
- Getting lada-cache error HOT 1
- issue with lada-cache
- Question regarding this library HOT 1
- Error when using whereHas with BelongsToMany
- I use 2 website setup lada-cache ( different prefix ) connect one redis. But when I delete one row in one website, redis cache empty. I use version 2.1 HOT 2
- Call to undefined function config_path() HOT 1
- Lada breaks Laravel Telescope HOT 11
- Add support for Lumen HOT 3
- How to load service provider during unit tests? HOT 2
- Class lada.handler does not exist HOT 4
- cleanBindings() must be of the type array, null given, whereHas > whereIn() issue? HOT 4
- Cache not refreshed for relations when using updateOrCreate() HOT 7
- Doesn't work with spatie / laravel-permission HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lada-cache.