Skip to content

Not working with app cache #80

Description

@diegocgaona

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:
image

If I delete it and use the myDataProvider, it works fine.

Is there a solution?

Thanks!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions