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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top