This GitHub repository presents a sample project that utilizes the axios-cache-interceptor middleware. The project is created to demonstrate how to use the axios-cache-interceptor caching middleware.
The sample project makes HTTP requests using Axios with a caching strategy that generates a cache key based on the request URL and parameters. The first time a request is made, the response is cached, and subsequent requests to the same URL utilize the cached response.
The project utilizes the following libraries:
- Expo
- react-navigation
- react-native-mmkv
- typescript
- await-to-js
- axios
- axios-cache-interceptor
- Clone the project:
git clone https://github.com/caglar09/axios-cache-interceptor-example.git
- Navigate to the project directory:
cd axios-cache-interceptor-example
- Install the required packages:
npm install
- Install the required packages for iOS:
cd ios && pod install && cd ..
- Start the project:
npm run ios
There is no need for any additional development for usage. Once the blog posts are automatically fetched, they will be cached. When the same parameters are used in subsequent requests, the cached data will be returned. To customize, refer to axios-cache-interceptor guide.
### License
This project is licensed under the MIT license. For more information, see the LICENSE file.