Skip to content

Conversation

@akhilmhdh
Copy link
Member

Description 📣

This PR does following things

  1. Added versioning to frontend assets
  2. Resolved caching of index.html that was happening due to etag added
  3. Fixed font source failing to load in frontend

Type ✨

  • Bug fix
  • New feature
  • Improvement
  • Breaking change
  • Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

@maidul98
Copy link
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 24, 2025

Greptile Overview

Greptile Summary

This PR implements a proper caching strategy for the SPA by adding versioned asset filenames and configuring appropriate cache headers. The changes address the etag caching issue that was preventing index.html from being properly refreshed.

Key changes:

  • Added version-based filenames to frontend assets using INFISICAL_PLATFORM_VERSION for cache busting
  • Configured 30-day immutable caching for static assets in @fastify/static plugin
  • Disabled all caching mechanisms for index.html (etag, lastModified, maxAge=0) to ensure SPA always loads fresh
  • Fixed font loading by moving @fontsource/inter imports from index.css to main.tsx
  • Added explicit INFISICAL_PLATFORM_VERSION environment variable in Dockerfile for proper propagation

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it implements standard SPA caching best practices
  • The implementation follows industry-standard patterns for SPA caching (long-lived immutable assets with versioned filenames, fresh index.html). The changes are well-scoped and address specific issues (etag caching, font loading). Minor point deduction because the version string handling with replaceAll(".", "-") is not typical but acceptable for this use case.
  • No files require special attention - all changes follow best practices

Important Files Changed

File Analysis

Filename Score Overview
backend/src/server/plugins/serve-ui.ts 4/5 Added aggressive caching for static assets (30d immutable) and disabled caching for index.html to prevent SPA stale cache issues
frontend/vite.config.ts 4/5 Added version-based file naming for assets using platform version to enable cache busting

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@maidul98 maidul98 merged commit 2c4505d into main Nov 24, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants