Skip to content

🔨 refactor: Add Cache Busting to index.html#3824

Merged
danny-avila merged 1 commit into
mainfrom
fix/cache-bust-html
Aug 28, 2024
Merged

🔨 refactor: Add Cache Busting to index.html#3824
danny-avila merged 1 commit into
mainfrom
fix/cache-bust-html

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

I implemented cache busting for the index.html file to ensure users always receive the latest version of the application. This change addresses potential issues where users might experience outdated content due to browser caching.

  • Added three meta tags to the index.html file for cache control:
    • Set 'cache-control' to "no-cache, no-store, must-revalidate"
    • Set 'expires' to '0'
    • Set 'pragma' to 'no-cache'
  • These additions prevent browsers from caching the index.html file, ensuring users always load the most recent version of LibreChat

Followup to #3822 as it will more explicitly cache js files based on code changes

Inspired by https://maxtsh.medium.com/the-ultimate-guide-to-cache-busting-for-react-production-applications-d583e4248f02

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

To test this change:

  1. Deploy the updated index.html file to a test environment
  2. Clear your browser cache
  3. Load the application and verify it's the latest version
  4. Reload the page multiple times to ensure no caching occurs
  5. Test on different browsers (Chrome, Firefox, Safari, etc.) to confirm consistent behavior

Test Configuration:

  • Various web browsers (Chrome, Firefox, Safari, Edge)
  • Different devices (Desktop, Mobile, Tablet)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings

@danny-avila danny-avila merged commit 757b6d3 into main Aug 28, 2024
@danny-avila danny-avila deleted the fix/cache-bust-html branch August 28, 2024 17:52
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
MichielMAnalytics pushed a commit to MichielMAnalytics/ProAI that referenced this pull request Jun 6, 2025
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.

1 participant