I’ve been on a caching crusade. I’m working to reduce the load on our database by focusing on various caching solutions. In an ideal world, data that is “static” will be heavily cached; minimal database interaction required. However, that’s not the world I’m living in. Each request to our GraphQL API leads directly to a database hit. Ugh!
Apollo GraphQL offers a few caching solutions to help with this endeavor. We decided to go with the responseCachePlugin. This plugin stores cacheable data in a datastore of your choice, for us that was Redis. The key thing to keep in mind is that the data must be cacheable. Which leads us to “the problem.”
Continue Reading