Giter VIP home page Giter VIP logo

Comments (9)

spiritix avatar spiritix commented on May 26, 2024

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.

george-kar avatar george-kar commented on May 26, 2024

@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.

spiritix avatar spiritix commented on May 26, 2024

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.

george-kar avatar george-kar commented on May 26, 2024

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.

spiritix avatar spiritix commented on May 26, 2024

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.

george-kar avatar george-kar commented on May 26, 2024

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.

spiritix avatar spiritix commented on May 26, 2024

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.

george-kar avatar george-kar commented on May 26, 2024

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.

spiritix avatar spiritix commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.