-
Notifications
You must be signed in to change notification settings - Fork 227
This could be down to my weird use case #39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I’m working on a feature for this. Will try to work on it tomorrow. |
Duplicate of #34. |
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. :) |
Cool thanks @mikebronner - good to know - I think something else is a play here on my end which is causing odd results :) |
So I'm definitely seeing some unexpected behaviour here. 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: |
I was tired and an idiot 🥇 fool! |
No worries, glad you found the root cause :) |
@mbuk I just released version 0.2.12 which adds the ability to disable caching on individual queries. |
Fantastic! I’ll check it out |
Issue
I have a complex query:
which I call like this:
$excludedIds, $includedInterests, $IncludedRegions are all arrays of ids
and $location is an integer.
I really don't want this query to be cached (or maybe a better way to put it is that I want this query to be excluded from the query cache, but I want the rest of the queries on the model to be cached).
I'm wondering if anything using a raw method https://laravel.com/docs/5.5/queries#raw-expressions should bypass the cache?
Alternatively is there a way I can clear that cache or skip caching or a given query?
Environment
Laravel Version: 5.5
Laravel Model Caching Package Version: 0.2.11
PHP Version: 7.1.10
Homestead Version: N/A
Operating System & Version: OSX High Sierra
The text was updated successfully, but these errors were encountered: