-
Notifications
You must be signed in to change notification settings - Fork 0
RFC: ETag support for Router #295
Copy link
Copy link
Open
Labels
[STAGE-2] incomplete implementationRemove this label when implementation is completeRemove this label when implementation is complete[STAGE-2] not fully covered by tests yetRemove this label when tests are verified to cover the implementationRemove this label when tests are verified to cover the implementation[STAGE-2] unresolved discussions leftRemove this label when all critical discussions are resolved on the issueRemove this label when all critical discussions are resolved on the issue[STAGE-3] docs changes not added yetRemove this label when the necessary documentation for the feature / change is addedRemove this label when the necessary documentation for the feature / change is added[STAGE-3] missing 2 reviews for RFC PRsRemove this label when at least 2 core team members reviewed and approved the RFC implementationRemove this label when at least 2 core team members reviewed and approved the RFC implementation
Metadata
Metadata
Assignees
Labels
[STAGE-2] incomplete implementationRemove this label when implementation is completeRemove this label when implementation is complete[STAGE-2] not fully covered by tests yetRemove this label when tests are verified to cover the implementationRemove this label when tests are verified to cover the implementation[STAGE-2] unresolved discussions leftRemove this label when all critical discussions are resolved on the issueRemove this label when all critical discussions are resolved on the issue[STAGE-3] docs changes not added yetRemove this label when the necessary documentation for the feature / change is addedRemove this label when the necessary documentation for the feature / change is added[STAGE-3] missing 2 reviews for RFC PRsRemove this label when at least 2 core team members reviewed and approved the RFC implementationRemove this label when at least 2 core team members reviewed and approved the RFC implementation
Type
Projects
Status
In Progress (STAGE 2)
Champion
@wmertens
What's the motivation for this proposal?
Objective
Enhance Qwik Router by introducing ETag support for routes and routeLoader$ functions to optimize server-side rendering (SSR) performance and caching efficiency.
Proposed Solution / Feature
Proposal
ETag Export for Routes:
Allow routes (e.g., index.tsx) to export an eTag function or include an eTag property in the head export.
The eTag function generates a unique ETag based on the route's content or relevant data.
For routes generated from .md files, derive the ETag from a hash of the rendered content, it will be just a string.
ETag Support for routeLoader$:
Enable routeLoader$ functions to generate ETags based on dynamic data (e.g., user-specific data like logged-in status).
Server-Side Behavior:
When a browser requests a route with an ETag after cache expiration, the server compares the provided ETag with the current route's ETag.
If the ETags match, the server returns a 304 Not Modified response, bypassing SSR to reduce server load.
If the ETags differ, the server performs SSR and returns the updated content with a new ETag.
Build-Time ETag Integration:
.mdfiles, can export their content hashBenefits
PRs/ Links / References
No response