'How do I compress HTML code with GZIP or with the .htaccess file?

So I want to compress my HTML code so that my website loads faster: Here's my GH repo

I know I need to configure the .htaccess on an Apache server or using GZIP, here's what I did

  1. I created a .htaccess file
  2. entered the commands:
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/plain
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
</IfModule>

The problem is that the website I'm supposed to enhance does not (and MUST not) have a server to communicate it with. It's basically a Front-End only project. Thus the HTML code does not get compressed at all.

And there I haven't seen any tutorial on how to setup this file.

Some help would be much appreciated



Solution 1:[1]

I don't know any of these as I am not into these yet! Just a newbie on HTML and CSS but I saw your post and did some research! I found this...

https://youtu.be/QDK2c7rokOw

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharman