Skip to content

Option to disable inner cache #75

Open
@srosset81

Description

@srosset81

I was using a custom document loader which handled cache, because the contexts were frequently updated.

However it took me some time to realize that there was an inner caching mechanism in this library, that bypassed the document loader.

To disable it manually, I did it like this:

this.contextParser = new ContextParser({
      documentLoader: {
        load: async url => {
          const result = await documentLoaderWithCache();
          this.contextParser.documentCache = {};
          return result;
        }
      }
    });

Maybe it would be a good idea to add an option to disable the inner cache ?

Another possibility would be to let the caching mechanism be handled by the document loader (like it is done by the jsonld.js library). But this would be a breaking change...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions