The car appeared pixelated and low quality on Netlify deployment despite having ultra quality settings in the code. This was NOT a code issue - it was a browser caching issue.
- Previous deployment had code that defaulted to medium/high quality
- Browser cached the old JavaScript bundle with aggressive 1-year cache headers
- New deployment with ultra quality settings was not being loaded
- User's browser continued serving the old cached JavaScript with lower quality settings
Modified netlify.toml to prevent HTML caching:
# Prevent caching of HTML files to ensure users get latest version
[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"
[[headers]]
for = "/"
[headers.values]
Cache-Control = "no-cache, no-store, must-revalidate"Why this works:
- HTML files are now always fetched fresh from the server
- HTML contains references to hashed JavaScript bundles (e.g.,
index-CTusykuK.js) - When HTML is fresh, it loads the latest JavaScript bundle
- JavaScript bundles still have 1-year cache (good for performance)
- Vite generates new hashes when code changes, so new bundles are always loaded
Added console logging in Game.ts to verify quality settings:
console.log(`[Quality] Applied: ${preset.id}`, {
resolutionScale: preset.resolutionScale,
hardwareScalingLevel,
shadowMapSize: preset.shadows.mapSize,
renderWidth: engine.getRenderWidth(),
renderHeight: engine.getRenderHeight()
});IMPORTANT: You must clear your browser cache first!
- Chrome/Edge (Windows/Linux): Press
Ctrl + Shift + RorCtrl + F5 - Chrome/Edge (Mac): Press
Cmd + Shift + R - Firefox (Windows/Linux): Press
Ctrl + Shift + RorCtrl + F5 - Firefox (Mac): Press
Cmd + Shift + R - Safari (Mac): Press
Cmd + Option + R
- Open DevTools (F12 or right-click → Inspect)
- Go to the Console tab
- Look for the quality log message:
[Quality] Applied: ultra {
resolutionScale: 1,
hardwareScalingLevel: 1,
shadowMapSize: 4096,
renderWidth: 1920, // Your screen width
renderHeight: 1080 // Your screen height
}
The car should now appear:
- ✅ Sharp and detailed
- ✅ Smooth edges (not pixelated)
- ✅ High-resolution textures
- ✅ Proper shadows (4096px shadow map)
- Resolution Scale: 1.0 (100% - full resolution)
- Hardware Scaling Level: 1 (no downscaling)
- Shadow Map Size: 4096px (highest quality shadows)
- Post-Processing: All effects enabled (TAA, SSAO, SSR, Motion Blur, Bloom)
Babylon.js setHardwareScalingLevel() works as follows:
- Level 1 = Full resolution (100%)
- Level 2 = Half resolution (50%)
- Level 1.176 = 85% resolution (1 / 0.85)
Formula: hardwareScalingLevel = 1 / resolutionScale
HTML Files: No cache (always fresh)
- Ensures users always get the latest bundle references
- Small file size (~0.42 kB) - negligible performance impact
JavaScript Bundles: 1-year cache (immutable)
- Vite generates hashed filenames (e.g.,
index-CTusykuK.js) - Hash changes when code changes
- Old bundles are never loaded because HTML references new hash
- Excellent performance - bundles only downloaded once
Static Assets: 1-year cache (immutable)
- Images, fonts, environment maps
- Never change, so safe to cache aggressively
- First deployment: Had medium/high quality defaults
- Browser cached: Old JavaScript bundle for 1 year
- Second deployment: Changed to ultra quality
- Browser still used: Old cached bundle (ignored new deployment)
- Result: Pixelated car despite ultra quality code
- HTML never cached: Always fetches fresh from server
- Fresh HTML loads: Latest JavaScript bundle (new hash)
- New code runs: Ultra quality settings applied
- Visual quality: Perfect!
✅ Committed: Commit 68d98b5
✅ Pushed: To GitHub main branch
✅ Netlify: Will auto-deploy in ~2 minutes
- Wait for Netlify deployment to complete (~2 minutes)
- Hard refresh your browser (Cmd+Shift+R on Mac, Ctrl+Shift+R on Windows)
- Check console logs to verify ultra quality is applied
- Enjoy crisp, high-quality visuals!
Note: If you still see pixelated graphics after hard refresh, try:
- Clear all browser cache (Settings → Privacy → Clear browsing data)
- Open in incognito/private window
- Try a different browser