Question

I'm attempting to cache the results of a query (DocumentSet) in hopes of enhancing performance on my clients application.

So before the find the app will check to see if an appropriate cache key exists and, if so, serve that rather than hitting the DB.

In my had it seems straight forward enough, however upon implementation all I get are time outs.

It appears the app has trouble storing the DocumentSet object into cache?

It's likely I'm missing something blindingly apparent ...

Thanks for your help.

Was it helpful?

Solution

So, I can't explain why but I'm unable to cache the documentset.

Instead I was forced to cache the documentset->to('array'). Then, while reading from cache create a new DocumentSet object by passing the models schema and the cached array, returning that.

Seems to be working fairly well, if not as elegant as I had hoped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top