Issue 269#517
Open
binayyub4211 wants to merge 17 commits into
Open
Conversation
…uality, notifications, and card components
|
@binayyub4211 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Kindly resolve conflict and fix workflow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #341
What was done
Implemented global CDN delivery for all static assets (images, fonts) with automatic SemVer-based URL versioning and aggressive 1-year cache headers enforced across three major deployment platforms.
Changes
New files:
src/utils/cdn.ts — Central CDN utility. Maps any asset path, remote URL, or require() module ID to a versioned CDN URL (https://cdn.teachlink.com/…?v=1.8.0). Handles URL sanitization, assets/ prefix stripping, and CDN URL version bumping.
vercel.json — Enforces Cache-Control: public, max-age=31536000, immutable for /assets/* on Vercel.
netlify.toml — Same 1-year cache header for Netlify deployments.
firebase.json — Same cache header for Firebase Hosting (dist/assets/**).
docs/cdn-strategy.md — Full CDN strategy documentation covering Cloudflare, AWS CloudFront, Vercel, Netlify, Firebase configs; curl verification commands; and performance monitoring KPIs (Cache Hit Ratio ≥ 95%, LCP, TTFB).
src/tests/utils/cdn.test.ts — 16 unit tests covering isCDNUrl, getCDNAssetUrl (null inputs, remote URLs, relative paths, assets/ prefix stripping, asset module ID resolution, error handling), and getCDNFontUrl.
Modified files:
src/components/ui/CachedImage.tsx — All image URIs are now rewritten through getCDNAssetUrl() before being passed to ImageCache.prefetchImages and expo-image. Local and remote paths are transparently mapped to the CDN origin.
src/services/fontService.ts — String font sources in loadFont() are routed through getCDNAssetUrl(), ensuring dynamically loaded fonts are fetched from CDN with cache busting on version bumps.
src/tests/components/imageCache.test.tsx — Added a CDN mock and updated prefetch assertions to expect CDN-versioned URLs. Added a dedicated "CDN URL rewriting" test scenario.