cache in graphqlite #465
Replies: 13 comments 3 replies
-
You can read the docs on PSR-16 cache integration: All the cache is handled internally, so you just need to pass a PSR-16 compatible cache adapter. Cache doesn't need to persist across servers, so Redis is a bad choice. Stick with something local, like APCU. |
Beta Was this translation helpful? Give feedback.
-
@andrew-demb yes i wan a implement cache in real world application (e-commerce website) to improve performance of the request when i execute a request time to respond is very high |
Beta Was this translation helpful? Give feedback.
-
@dhiabenjaber what have you implemented so far? Are you using opcache? What about pre-loading? Are you spinning up a lot of instances? Is this every request? Have you checked your database cache layers? Please see XDebug's profiler: Can you please get us a summary of these results on a troublesome request? |
Beta Was this translation helpful? Give feedback.
-
@oojacoboo this is screenshots from xdebug profiler |
Beta Was this translation helpful? Give feedback.
-
@dhiabenjaber what does your GraphQLite configuration look like? What cache implementation are you using here? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Please try |
Beta Was this translation helpful? Give feedback.
-
Also, that's just a Symfony component. You don't need to be using the Symfnoy framework to use Symfony component libs. They're standalone libs. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@dhiabenjaber This callstack analysis doesn't tell much of a story. It looks like your autoloader is taking more time than needed though. Are you using opcache? The autoload should be cached. With 7.4 you can pre-load as well (https://www.php.net/manual/en/opcache.preloading.php) You need to show what's taking more time. If 10% on autoload is your biggest issue... that's your biggest issue. If it's something else... it's not in the screenshot. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@dhiabenjaber you can see here what that is: https://github.com/webonyx/graphql-php/blob/master/src/Language/Visitor.php This is part of the webonyx lib that GraphQLite is built upon. |
Beta Was this translation helpful? Give feedback.
-
i want to understand how to manage cache with graphiqlte (other no framework) and if there is an example of code cache with memcached, redis ... and what is the purpose of the Adapter
Beta Was this translation helpful? Give feedback.
All reactions