Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Redis Axios Caching vs direct Axios MariaDB Calls #235

Open
jasperf opened this issue Feb 25, 2021 · 2 comments
Open

Redis Axios Caching vs direct Axios MariaDB Calls #235

jasperf opened this issue Feb 25, 2021 · 2 comments

Comments

@jasperf
Copy link

jasperf commented Feb 25, 2021

Are there any benchmark tests showing how Axios caching stands vs direct Axios calls? Currently we have a database server and a web server connected internally on the same local network on DigitalOcean servers. One of the calls to menus for site is at the very end after other Axios calls, HTML and PHP as well as images. So to remedy this on subsequent calls for other pages we thought.. well let's at least cache these menu requests by Axios and perhaps the other calls too. But if Redis would be on the same server as web services or in the same network.. would this really matter loading time wise?

@jasperf
Copy link
Author

jasperf commented Mar 3, 2021

We decided to use Laravel Cache Facade for basic database request caching https://laravel.com/docs/master/cache . We however still seem to miss ways to cache Axios Requests so they do not have to be made to the Redis or MySQL database. So we are looking into localStorage and Forage and so perhaps still the Axios Cache Adapter.

@ghost
Copy link

ghost commented Mar 3, 2021

Hello @jasperf thank you for considering using axios-cache-adapter.

Sorry, I do not have benchmarks showing how faster it would be using the adapter with a local store vs actually making a network request, it depends on a lot of things. But generally speaking, it should be faster (except if you have a crazy fast internet connection then it might just be similar I guess).

I am currently not using the project in any of my projects but I created it while working in a big company that had a somewhat slow backend API. When serving data through the local cache, the pages would render almost 100 times faster (also because the app had to make a lot of calls to be able to render any pages).

You will probably have to make a POC to really compare response time differences with your setup. Sorry I could not provide more detailed information on this.

If you have any other questions don't hesitate 😉

Cheers

@jasperf jasperf changed the title Redis Axio Caching vs direct Axios MariaDB Calls Redis Axios Caching vs direct Axios MariaDB Calls Mar 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant