Skip to content

Font-Awesome Fix and Caching#6

Merged
jmbarne3 merged 5 commits into
mainfrom
caching
Feb 18, 2026
Merged

Font-Awesome Fix and Caching#6
jmbarne3 merged 5 commits into
mainfrom
caching

Conversation

@jmbarne3
Copy link
Copy Markdown
Contributor

  • Removes the FontAwesome react component and just directly loads the kit in the head.
  • Replaces the FontAwesome components with i elements and the appropriate classes.
  • Adds a blanket 1 year local caching rule to all files under /assets. For JS and CSS, cache busting occurs as any updates changes the hash in the filename.

Reasons/Motivations:

  • When we added the font-awesome react component, the bundled size of our JS asset went from about 250k to 11MB. There are likely ways around this bundle size, but as our use of fonts in this project is extremely simple, I've chosen to handle it the old fashion way.
  • Local caching should reduce the amount of requests that make it back to Azure.

@jmbarne3 jmbarne3 requested review from Copilot and mcatech February 18, 2026 18:03
@jmbarne3 jmbarne3 self-assigned this Feb 18, 2026
@jmbarne3 jmbarne3 added the bug Something isn't working label Feb 18, 2026
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-tree-070bd9f0f-6.eastus2.3.azurestaticapps.net

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies Font Awesome integration by removing the React component library approach in favor of direct CDN kit loading, which reduces bundle size from ~250KB to ~11MB back down significantly. It also implements client-side caching for static assets to reduce server requests.

Changes:

  • Replaced Font Awesome React components with plain <i> elements using Font Awesome CSS classes
  • Added Font Awesome kit script to HTML head for CDN-based loading
  • Implemented 1-year cache policy for CSS and JS assets in Azure Static Web Apps configuration
  • Removed @fortawesome/react-fontawesome dependency

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
staticwebapp.config.json Adds caching headers (1-year max-age, immutable) for CSS and JS assets
index.html Adds Font Awesome kit CDN script to document head
src/components/LocationResults.tsx Replaces FontAwesomeIcon components with <i> elements and removes Font Awesome imports
package.json Removes @fortawesome/react-fontawesome dependency
package-lock.json Removes Font Awesome React component and related peer dependency entries

Comment thread index.html Outdated
Comment thread staticwebapp.config.json Outdated
Comment thread src/components/LocationResults.tsx Outdated
Comment thread src/components/LocationResults.tsx Outdated
Comment thread package.json Outdated
jmbarne3 and others added 2 commits February 18, 2026 13:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-tree-070bd9f0f-6.eastus2.3.azurestaticapps.net

1 similar comment
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-tree-070bd9f0f-6.eastus2.3.azurestaticapps.net

@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-tree-070bd9f0f-6.eastus2.3.azurestaticapps.net

@jmbarne3 jmbarne3 requested review from a team, angeltagudin and kimberspencer and removed request for a team and mcatech February 18, 2026 18:43
@jmbarne3 jmbarne3 merged commit ba546b6 into main Feb 18, 2026
6 checks passed
@jmbarne3 jmbarne3 deleted the caching branch February 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants