Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6328 from edx/derf/typo-on-favicon.ico,-weird-braces
Browse files Browse the repository at this point in the history
typo on favicon.ico, weird braces
  • Loading branch information
Fred Smith authored Mar 24, 2021
2 parents 78bcdb0 + e94effd commit d7abfb8
Showing 1 changed file with 25 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,29 @@ server {
add_header Cache-Control "no-store, max-age=0" always;
}

# Cache js/css for a long time at the edge, they are versioned in their names
location ~ \.(js|css)$ {
add_header 'Cache-Control' 'public, max-age=31536000, immutable';
}

# data.json files are used to rehydrate the page, they can be cached for a 30 minutes at the edge.

location ~ data\.json$ {
add_header 'Cache-Control' 'public, max-age=1800';
}

# images sometimes change, we want to cache them for an hour at the edge to reduce bandwidth.

location /images/ {
add_header 'Cache-Control' 'public, max-age=3600';
}

# favicon is requested a lot. cache it at the edge.

location /favicon.ico {
add_header 'Cache-Control' 'public, max-age=86400';
}


# Ignore the rollout group headers for the health check endpoint.
location /HealthCheck {
Expand All @@ -54,6 +77,8 @@ server {
try_files $uri $uri/ /bio/index.html;
}

# preview pages are not cached, and have basic auth

location /secure-preview/ {
{% if PROSPECTUS_PREVIEW_ENABLE_BASIC_AUTH|bool %}
auth_basic "Restricted";
Expand All @@ -77,10 +102,6 @@ server {
add_header Cache-Control "no-store, max-age=0";
}

location /images/ {
add_header 'Cache-Control' 'public, max-age=3600';
}

location /es/preview/ {
port_in_redirect off;
add_header Cache-Control "no-store, max-age=0";
Expand All @@ -98,20 +119,6 @@ server {
}
{% endfor %}

location / {
location ~ \.(js|css)$ {
add_header 'Cache-Control' 'public, max-age=31536000, immutable';
}

location / {
location ~ data\.json$ {
add_header 'Cache-Control' 'public, max-age=1800';
}
}

location /favico.ico {
add_header 'Cache-Control' 'public, max-age=86400';
}


{% if prospectus_redirect_file is defined %}
Expand All @@ -123,7 +130,6 @@ server {

add_header 'Cache-Control' 'public, max-age=0, must-revalidate';
try_files $uri $uri/index.html =404;
}

# PROSPECTUS_STATIC_SITES will be a list of dictionaries which have a:
# - router_path: The path you will go to on the router to access the content
Expand Down

0 comments on commit d7abfb8

Please sign in to comment.