Skip to content

Commit

Permalink
Merge pull request #2180 from cfpb/2120-pageSpeed
Browse files Browse the repository at this point in the history
Updates to improve Google Lighthouse Scores
  • Loading branch information
ojbravo authored May 1, 2024
2 parents 36d8696 + e4b8812 commit e078960
Show file tree
Hide file tree
Showing 13 changed files with 751 additions and 5,616 deletions.
39 changes: 39 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,40 @@

<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon-precomposed" href="/favicon.ico" />
<link
rel="preload"
fetchpriority="high"
as="image"
href="/src/common/images/hmda-hero.min.jpg"
type="image/jpeg"
/>
<link
rel="preload"
href="/assets/sourcesanspro-regular-webfont-BZtNapR-.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/assets/sourcesanspro-bold-webfont-qYDZUBzB.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/assets/uswds-init.min-D1tzE0C5.js"
as="script"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/assets/uswds.min-BjNqw5Kx.js"
as="script"
crossorigin="anonymous"
/>

<!--
Notice the use of in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand All @@ -27,6 +61,11 @@
</script>
<script type="module" src="/src/index.jsx"></script>
<!-- Google Tag Manager -->
<link
rel="preconnect"
href="https://www.googletagmanager.com"
crossorigin
/>
<script>
;(function (w, d, s, l, i) {
w[l] = w[l] || []
Expand Down
3 changes: 2 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ http {
application/json max;
application/javascript max;
~image/ max;
font/woff2 max;
}

# Limit connections per IP address
Expand Down Expand Up @@ -83,7 +84,7 @@ http {
}

# Whitelisted extensions
location ~* \.(html|css|js|json|png|jpg|gif|svg|eot|ttf|woff|woff2|map|ico)$ {
location ~* \.(html|css|js|json|png|jpg|gif|svg|eot|ttf|woff|woff2|map|ico|txt|xml)$ {
limit_except GET {
deny all;
}
Expand Down
3 changes: 3 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
User-agent: *
Disallow:
Sitemap: https://ffiec.cfpb.gov/sitemap.xml
Loading

0 comments on commit e078960

Please sign in to comment.