Skip to content

[Port dspace-8_x] Prefetch rest responses#4082

Draft
AAwouters wants to merge 25 commits intoDSpace:dspace-8_xfrom
atmire:prefetch-rest-responses-8_x
Draft

[Port dspace-8_x] Prefetch rest responses#4082
AAwouters wants to merge 25 commits intoDSpace:dspace-8_xfrom
atmire:prefetch-rest-responses-8_x

Conversation

@AAwouters
Copy link
Copy Markdown
Contributor

dspace-8_x port of #4081

ybnd and others added 23 commits February 14, 2025 00:11
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-8_x

# Conflicts:
#	config/config.example.yml
#	package.json
#	server.ts
#	src/app/app.module.ts
#	src/app/core/auth/auth.interceptor.spec.ts
#	src/app/core/browse/browse-definition-data.service.ts
#	src/app/core/cache/builders/remote-data-build.service.ts
#	src/app/core/cache/object-cache.service.ts
#	src/app/core/core.module.ts
#	src/app/core/data/base-response-parsing.service.ts
#	src/app/core/data/base/create-data.ts
#	src/app/core/data/browse-response-parsing.service.spec.ts
#	src/app/core/data/default-change-analyzer.service.ts
#	src/app/core/data/dspace-rest-response-parsing.service.ts
#	src/app/core/data/endpoint-map-response-parsing.service.ts
#	src/app/core/data/request.effects.ts
#	src/app/core/dspace-rest/dspace-rest.service.spec.ts
#	src/app/core/dspace-rest/dspace-rest.service.ts
#	src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts
#	src/app/core/log/log.interceptor.spec.ts
#	src/app/core/shared/flat-browse-definition.model.ts
#	src/app/core/shared/hierarchical-browse-definition.model.ts
#	src/app/core/shared/value-list-browse-definition.model.ts
#	src/app/core/xsrf/xsrf.interceptor.spec.ts
#	src/app/init.service.ts
#	src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts
#	src/app/shared/theme-support/theme.service.spec.ts
#	src/app/shared/theme-support/theme.service.ts
#	src/app/statistics/statistics.module.ts
#	src/config/app-config.interface.ts
#	src/config/config.server.ts
#	src/config/default-app-config.ts
#	src/environments/environment.test.ts
#	src/main.browser.ts
#	src/modules/app/browser-init.service.ts
#	src/modules/app/server-init.service.ts
#	yarn.lock
@AAwouters AAwouters mentioned this pull request Mar 14, 2025
12 tasks
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 9, 2025

Hi @AAwouters,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Feb 5, 2026
DSC-2726 Added isCommunityAdmin or isSiteAdmin check for the communities and collection menu entry

Approved-by: Andrea Barbasso
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
activity in one year. It will be closed in 14 days if no further activity occurs.

Allowing pull requests to close as stale helps us filter out old work that is no longer
relevant and helps developers focus on reviewing current work.

All pull requests closed by this bot act like normal pull requests;
they can be searched for, commented on or reopened at any point.

If these changes are still relevant then please comment and/or rebase your PR based on the
latest DSpace code. This will remove the stale status and notify us to assign a reviewer
for your PR.

@github-actions github-actions Bot added the stale This issue or PR is stale because it has not been updated in a long time. label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict stale This issue or PR is stale because it has not been updated in a long time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants