문제

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