Giter Club home page Giter Club logo

Comments (9)

mikebronner avatar mikebronner commented on July 29, 2024

I’m working on a feature for this. Will try to work on it tomorrow.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Duplicate of #34.

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

Hi Matt, just wanted to note that the model cache will respect your entire complex where clause will be processed accordingly and not cause false returns, even with dynamic data.

But I do understand the need to prevent caching of a query and will work on that, just wanted to share that the caching should be able to handle your use case. :)

from laravel-model-caching.

mbuk avatar mbuk commented on July 29, 2024

Cool thanks @mikebronner - good to know - I think something else is a play here on my end which is causing odd results :)

from laravel-model-caching.

mbuk avatar mbuk commented on July 29, 2024

So I'm definitely seeing some unexpected behaviour here.
The use case is - a list of suggestions filtered on yourself, your already connected / invited users.
When my Profile model is extending CachedModel list of suggestions doesn't decrease when I connect with another user. When Profile model isn't extending CachedModel it behaves as expected.

If I mess around manually with my excluded $excludedIds - when caching is on - the list doesn't change - when caching is off it's as expected. It's 04:30 here so going to get some rest - but I'll put together a use case on fresh install of laravel later today and see if I can replicate the some issue on that with a base use case.

The key being created by the package is:
appprofile_and_profilesuser-id-not-in-and-profilesactive-1-and-profilesuser-id-inselect-user-id-from-user-interests-where-interest-id-in-or-profilesuser-id-inselect-user-id-from-user-locations-where-region-id-in-or-profilesuser-id-inselect-user-id-from-profiles-where-country-id_orderByRaw_rand-limit_10 and I don't see that change too much unless I adjust profile.active = 0 when it becomes: appprofile_and_profilesuser-id-not-in-and-profilesactive-0-and-profilesuser-id-inselect-user-id-from-user-interests-where-interest-id-in-or-profilesuser-id-inselect-user-id-from-user-locations-where-region-id-in-or-profilesuser-id-inselect-user-id-from-profiles-where-country-id_orderByRaw_rand-limit_10

from laravel-model-caching.

mbuk avatar mbuk commented on July 29, 2024

I was tired and an idiot 🥇 fool!
I'd messed my bindings up......... sorry!

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

No worries, glad you found the root cause :)

from laravel-model-caching.

mikebronner avatar mikebronner commented on July 29, 2024

@mbuk I just released version 0.2.12 which adds the ability to disable caching on individual queries.

from laravel-model-caching.

mbuk avatar mbuk commented on July 29, 2024

Fantastic! I’ll check it out

from laravel-model-caching.

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.