Improve loading performance

This commit is contained in:
Hazem Krimi
2023-11-22 18:18:23 +01:00
parent b790da4c73
commit e05564729d
15 changed files with 25 additions and 8 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

+1 -1
View File
@@ -18,4 +18,4 @@ This is a project that I made as a step in the interview process for my final ye
## Screenshots ## Screenshots
![Project screenshot](react-weather-app-screenshot.png) ![Project screenshot](react-weather-app-screenshot.webp)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

+17
View File
@@ -39,3 +39,20 @@ enableRobotsTXT = true
name = 'Contact' name = 'Contact'
url = '/contact' url = '/contact'
weight = 5 weight = 5
[[deployment.matchers]]
# Cache static assets for 1 year.
pattern = "^.+\\.(js|css|svg|ttf)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = true
[[deployment.matchers]]
pattern = "^.+\\.(gif|png|jpg|webp)$"
cacheControl = "max-age=31536000, no-transform, public"
gzip = false
[[deployment.matchers]]
# Set custom content type for /sitemap.xml
pattern = "^sitemap\\.xml$"
contentType = "application/xml"
gzip = true
[[deployment.matchers]]
pattern = "^.+\\.(html|xml|json)$"
gzip = true
+2 -2
View File
@@ -7,10 +7,10 @@
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ $faceImage := resources.Get "images/big-face.png" }} {{ $faceImage := resources.Get "images/big-face.webp" }}
<section> <section>
<img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face"> <img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face" loading="lazy">
{{ .Content }} {{ .Content }}
</section> </section>
+2 -2
View File
@@ -4,7 +4,7 @@
<link rel="stylesheet" href="{{ $styles.Permalink }}" /> <link rel="stylesheet" href="{{ $styles.Permalink }}" />
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ $faceImage := resources.Get "images/big-face.png" }} {{ $faceImage := resources.Get "images/big-face.webp" }}
<section id="intro"> <section id="intro">
<div> <div>
@@ -15,7 +15,7 @@
<a href="{{ urls.JoinPath .Site.BaseURL "contact" }}">Contact</a> <a href="{{ urls.JoinPath .Site.BaseURL "contact" }}">Contact</a>
</div> </div>
</div> </div>
<img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face"> <img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face" loading="lazy">
</section> </section>
<section id="about"> <section id="about">
+1 -1
View File
@@ -1,5 +1,5 @@
{{ $cv := resources.Get "cv.pdf" }} {{ $cv := resources.Get "cv.pdf" }}
{{ $faceImage := resources.Get "images/borded-face.png" }} {{ $faceImage := resources.Get "images/borded-face.webp" }}
<div id="about-card"> <div id="about-card">
<img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face" /> <img src="{{ $faceImage.Permalink }}" alt="Hazem Krimi's face" />
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $faceImage := resources.Get "images/small-face.png" }} {{ $faceImage := resources.Get "images/small-face.webp" }}
{{ $cv :=resources.Get "cv.pdf" }} {{ $cv :=resources.Get "cv.pdf" }}
<footer> <footer>
+1 -1
View File
@@ -1,4 +1,4 @@
{{ $faceImage := resources.Get "images/small-face.png" }} {{ $faceImage := resources.Get "images/small-face.webp" }}
{{ $cv := resources.Get "cv.pdf" }} {{ $cv := resources.Get "cv.pdf" }}
<header> <header>