Added cache system for schema loader.
Summary
This PR allows the schema loader to cache external schemas which were fetched by Ajax calls. The cache is the browser's localStorage storage. Caching is opt-in feature. By default, the caches are valid only for the current calendar day. However, the consumer can pass an explicit cache buster (e.g., the cache buster can be a hash of the schemas, to invalidate caches when any schema changes).
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ✔️ |
| Is backward-compatible? | ✔️ |
| Tests pass? | ✔️ |
| Fixed issues | None |
| Updated README/docs? | ✔️ |
| Added CHANGELOG entry? | ❌ |
@schmunk42 , this is ready for review. Tests pass locally (unit and e2e).
Hi @chhill-redhat,
Because the whole functionality of the json-editor depends on the schema-loader component, this PR will take a little more time to review as usual. We will give you feedback as soon as possible.
@germanbisurgi , thank you for the update!
Hi @germanbisurgi wondering if there are any updates on this PR. Thanks.
Hi @germanbisurgi and @schmunk42, has there been any more opportunity to review and test this work to get it pushed forward?
What are the best next steps to get this pushed forward?
Sorry guys for the delay, we were just not able to find enough time to review.
@chhill-redhat From my side it would be fine, since it is fully BC-compatible in the default setting, right? So no cache is used when not explicitly enabled.
@schmunk42 , no worries! You're right, it's BC by default, because the cache is disabled unless explicitly enabled.
@chhill-redhat Available in 2.9.0-beta.0 - thank you!
Great. Thank you, @schmunk42 ! Really appreciate it.