Cache Pagerfanta object or data #28
Closed
spointecker
started this conversation in
General
Replies: 1 comment
-
Assuming you are using Doctrine, you would be better off using its query caching features instead of trying to cache a Pagerfanta instance. The Pagerfanta class, and many of the adapters, are stateful classes that rely on data from a particular request and aren't really well suited to be cached themselves. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I tried to cache the pagerfanta result (the whole object
Pagerfanta
) with Symfony cache and I am getting the following error:WARNING: Failed to save key "...." of type array.
(I used caching via Symfony\Contracts\Cache\CacheInterface and Symfony\Contracts\Cache\ItemInterface).
Is there a way to cache the response of Pagerfanta?
Symfony: 4.4.16
PagerfantaBundle: 2.8.0
Beta Was this translation helpful? Give feedback.
All reactions