Not working with app cache
diegocgaona opened this issue · comments
Diego Gaona commented
If I use the application cache suggestion from https://marmelab.com/react-admin/Caching.html#application-cache , the import button do not work
const cacheDataProviderProxy = (dataProvider, duration = 2 * 60 * 1000) =>
new Proxy(dataProvider, {
get: (target, name) => (resource, params) => {
if (name === 'getOne' || name === 'getMany' || name === 'getList') {
return dataProvider[name](resource, params).then(response => {
const validUntil = new Date();
validUntil.setTime(validUntil.getTime() + duration);
response.validUntil = validUntil;
return response;
});
}
return dataProvider[name](resource, params);
},
});
export default cacheDataProviderProxy(myDataProvider);
With the cache active, the import button do not make an API call, it stops as the image bellow:
If I delete it and use the myDataProvider, it works fine.
Is there a solution?
Thanks!!