Closed currybob closed 6 years ago
We will use a cache layer. Our many requests are not a problem.
https://www.npmjs.com/package/cache-manager
This is a example on express server.
const cacheManager = require('cache-manager')
const axios = require('axios')
const cache = cacheManager.caching({
store: 'memory',
ttl: 30,
})
async function getEventData(eventId) {
const cacheKey = `event-${eventId}`
return await cache.wrap(cacheKey, async () => {
return await axios.get(`/v1/event/${eventId}`)
})
}
@aeei help you.
This page needs data that contains user name, job, and bio. but when requested, the return data is like that.
To get other data, we usually needs re-request for a property marked as "url" Not only this case, separating the api for Github data seems to be more efficient. because we will be getting more star, fork, or more data about the user who wrote the code.
I would appreciate if anyone could comment on this issue