-
-
Notifications
You must be signed in to change notification settings - Fork 569
Description
I'm profiling my application using Blackfire. Right now around 25% of the time to response is consumed by \GraphQL\Validator\DocumentValidator::validate(). This is quite a lot. I need some way to either significantly reduce the validation time or to cache the result for the same requests in the future to avoid running the validation again.
I don't think reducing the validation time is possible - or not by much. Caching the result should be possible but from the code this doesn't seem to be supported at the moment. Can you give me some advice how to implement it?
It's not necessary to cache the result of a request with errors, those will be rare and can be slow. No need to fill the cache. But normal successful requests need to be as fast as possible and this slows them down significantly.