Skip to content

cmd/dcrdata: add cache headers to improve page load on select pages#2030

Merged
dajohi merged 2 commits intodecred:masterfrom
ukane-philemon:etag
Nov 6, 2025
Merged

cmd/dcrdata: add cache headers to improve page load on select pages#2030
dajohi merged 2 commits intodecred:masterfrom
ukane-philemon:etag

Conversation

@ukane-philemon
Copy link
Collaborator

This PR adds the ETag, Last-Modified and Cache-Control headers on select explorer changes to improve user experience and save resources.

The ETag and Last-Modified are reset when *explorerUI receives a new block or mempool data. In the future, they might be reset in other call sites where update to backend cached data are made and API endpoints or pages depending on cached data should then use the ETagAndLastModifiedIntercept middleware.

Closes #32

This PR adds the ETag, Last-Modified and Cache-Control headers on select
explorer changes to improve user experience and save resources.

The ETag and Last-Modified are reset when *explorerUI receives a new block
or mempool data. In the future, they might be reset in other call sites where
update to backend cached data are made and API endpoints or pages depending on
cached data should then use the ETagAndLastModifiedIntercept middleware.

Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
Signed-off-by: Philemon Ukane <ukanephilemon@gmail.com>
@dajohi dajohi merged commit 3e81b7d into decred:master Nov 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Last-Modified and ETag headers especially in mempool responses

2 participants