Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRDCDH-2450 Add react-specific caching policies #647

Open
wants to merge 2 commits into
base: 3.3.0
Choose a base branch
from
Open

Conversation

amattu2
Copy link
Member

@amattu2 amattu2 commented Mar 11, 2025

Overview

This PR changes the production Nginx caching policies to align with a more React-specific deployment. Specifically:

  • Enforce NO caching on the index.html file, which references the React chunks
  • Enforce 1hr max cache on the injectEnv.js file
  • Enforce a 1mo cache duration for most static assets

These are somewhat arbitrary baselines, but we can adjust as needed.

Change Details (Specifics)

N/A

Related Ticket(s)

CRDCDH-2450 (Task)

@amattu2 amattu2 added this to the 3.3.0 milestone Mar 11, 2025
@coveralls
Copy link
Collaborator

coveralls commented Mar 11, 2025

Pull Request Test Coverage Report for Build 13795278265

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 60.279%

Totals Coverage Status
Change from base Build 13771365852: 0.0%
Covered Lines: 4372
Relevant Lines: 6833

💛 - Coveralls

@amattu2 amattu2 marked this pull request as ready for review March 11, 2025 18:16
@amattu2 amattu2 requested a review from Alejandro-Vega March 11, 2025 18:17
Copy link
Collaborator

@Alejandro-Vega Alejandro-Vega left a comment

Choose a reason for hiding this comment

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

Most of it LGTM, I did find 2 potential concerns by running it through a tool. Please take a look below.

@@ -13,8 +13,22 @@ server {
return 301 /submission-request/$1;
}

location / {
try_files $uri $uri/ /index.html;
location / {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I ran the configuration file through a security check using the following tool:
https://www.getpagespeed.com/check-nginx-config

It brought up some valid concerns such as nesting the "add_header" drops parent headers, as well as the try_files should probably be used with open_file_cache to negate overhead caused by try_files alone. Please take a look.

@Alejandro-Vega Alejandro-Vega added the 📝 Change Requested This PR has requested changes label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 Change Requested This PR has requested changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants