Skip to content

Commit fcd91b2

Browse files
committed
update cache busting section of getting started page in BlazorUI demo #11336
1 parent eb3a953 commit fcd91b2

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/GettingStartedPage.razor

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,54 @@
132132
<CodeBox>&lt;script src="_content/Bit.BlazorUI/scripts/bit.blazorui.js?v=@@Bit.BlazorUI.Info.Version">&lt;/script></CodeBox>
133133
<b>Note</b>: You can only use this feature in the <BitTag Color="BitColor.TertiaryBackground">App.razor</BitTag> file,
134134
for other root files (like index.html in a WASM standalone project) you have to apply another solution,
135-
for example manually adding the version query string to the resrouce URLs.
135+
for example manually adding the version query string to the resource URLs.
136136
</BitText>
137+
138+
<br />
139+
140+
<BitAccordion Title="Optional components">
141+
<BitText Typography="BitTypography.Body1">
142+
<b>Automatic Resource Fingerprinting</b>
143+
<br/>
144+
The <BitLink Href="https://www.nuget.org/packages/Bit.BlazorUI.Assets/" Target="_blank">Bit.BlazorUI.Assets</BitLink> package provides two
145+
standalone components designed for automatic resource fingerprinting in the <BitTag Color="BitColor.TertiaryBackground">App.razor</BitTag> file:
146+
</BitText>
147+
148+
<br /><br />
149+
150+
<BitText Typography="BitTypography.Body1">
151+
<b>Script</b>: A drop-in replacement for the standard HTML <BitTag Color="BitColor.TertiaryBackground">&lt;script></BitTag> tag.
152+
It automatically fingerprints the resource URL (<BitTag Color="BitColor.TertiaryBackground">src</BitTag> attribute) by
153+
calculating a hash from the actual file content, ensuring reliable cache busting and versioning.
154+
</BitText>
155+
<CodeBox>&lt;Script Src="_content/Bit.BlazorUI/scripts/bit.blazorui.js">&lt;/Script></CodeBox>
156+
<BitText Typography="BitTypography.Body1">
157+
The result would be something like this:
158+
</BitText>
159+
<CodeBox>&lt;script src="_content/Bit.BlazorUI/scripts/bit.blazorui.js?v=sha256-Z5yBv0K89OBRVurhAVzatpp3aGXsNn00e3GzQiTq_Z4">&lt;/script></CodeBox>
160+
161+
<br /><br />
162+
163+
<BitText Typography="BitTypography.Body1">
164+
<b>Link</b>: A direct replacement for the standard HTML <BitTag Color="BitColor.TertiaryBackground">&lt;Link></BitTag> tag.
165+
It automatically fingerprints the resource URL (<BitTag Color="BitColor.TertiaryBackground">href</BitTag> attribute) by
166+
generating a hash from the actual file content, providing consistent cache busting and version management.
167+
</BitText>
168+
<CodeBox>&lt;Link Href="_content/Bit.BlazorUI/styles/bit.blazorui.css" rel="stylesheet" /></CodeBox>
169+
<BitText Typography="BitTypography.Body1">
170+
The result would be something like this:
171+
</BitText>
172+
<CodeBox>&ltlink href="_content/Bit.BlazorUI/styles/bit.blazorui.css?v=sha256-VI6BIGZLTtmyhn3V-4RH-Yyi0Ud3p0g5dHvByeaoZ9Y" rel="stylesheet"></CodeBox>
173+
174+
<br /><br />
175+
<BitText Typography="BitTypography.Body1">
176+
<b>Note</b>: You can checkout the usages of these two components in our demo website project
177+
<BitLink Target="_blank"
178+
Href="https://github.com/bitfoundation/bitplatform/blob/develop/src/BlazorUI/Demo/Bit.BlazorUI.Demo.Server/Components/App.razor">
179+
here
180+
</BitLink>.
181+
</BitText>
182+
</BitAccordion>
137183
</section>
138184

139185
<FeedbackSection Url="GettingStartedPage.razor" />

0 commit comments

Comments
 (0)