[Port dspace-7_x] Prefetch rest responses#4083
Draft
AAwouters wants to merge 24 commits intoDSpace:dspace-7_xfrom
Draft
[Port dspace-7_x] Prefetch rest responses#4083AAwouters wants to merge 24 commits intoDSpace:dspace-7_xfrom
AAwouters wants to merge 24 commits intoDSpace:dspace-7_xfrom
Conversation
DSpace Angular's production server can modify the configuration it serves to CSR-only clients through YAML or environment variables. However, these files can remain cached in the browser and leave users with out-of-date configuration until the TTL runs out or the user does a "hard refresh". On build time this sort of problem is solved by saving the content hash as part of the path of each file (JS, CSS, ...) We introduce HashedFileMapping to bridge the same gap for dynamic content generated _after_ the server is built: - Files added to this mapping on the server are copied to a hashed path - A copy is injected into index.html, where clients can read it out and resolve the hashed paths - If a given path is not found in the mapping, the client will fall back to the original version (to prevent errors in development mode) With this mechanism we can ensure updates to config.json and similar files take immediate effect without losing the performance benefit of client-side caching.
The JSON mapping needs to be declared as a data block, otherwise browers may complain (nothing seems to really break though, except for Cypress) See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#any_other_value
….6_CLEAN' into w2p-124369_Bootstrap-HAL-endpoint-maps
…est-responses-7_x # Conflicts: # config/config.example.yml # package.json # src/app/app.module.ts # src/app/core/cache/object-cache.service.ts # src/app/core/core.module.ts # src/app/core/data/request.effects.ts # src/app/core/shared/hierarchical-browse-definition.model.ts # src/app/shared/theme-support/theme.service.spec.ts # src/app/shared/theme-support/theme.service.ts # src/config/app-config.interface.ts # src/config/default-app-config.ts # src/environments/environment.test.ts # src/modules/app/browser-init.service.ts # src/modules/app/server-init.service.ts
…est-responses-7_x
…est-responses-7_x # Conflicts: # src/modules/app/browser-init.service.ts
|
Hi @AAwouters, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dspace-7_x port of #4081