Hey there! I’ve been using Axios con Next 14 in API routes, and it’s been working great for me. It keeps the frontend clean and lets you handle all the logic server-side.
For caching, I’d suggest looking into `swr` or `react-query`. They integrate seamlessly with Next.js and make caching a breeze.
Here’s a quick example of using Axios in an API route:
```javascript
export default async function handler(req, res) {
const response = await axios.get('https://api.yoursite.com/data');
res.status(200).json(response.data);
}
```
Hope this gives you some ideas!
For caching, I’d suggest looking into `swr` or `react-query`. They integrate seamlessly with Next.js and make caching a breeze.
Here’s a quick example of using Axios in an API route:
```javascript
export default async function handler(req, res) {
const response = await axios.get('https://api.yoursite.com/data');
res.status(200).json(response.data);
}
```
Hope this gives you some ideas!
