ChrisTitusTech / website

My HUGO Website that I use for Videos, Blogs, and Redirects
74 stars 44 forks source link

Add rule to Cloudflare to minify page responses #181

Closed obfuscated-loop closed 1 month ago

obfuscated-loop commented 3 months ago

I noticed that you're using Cloudflare Pages to deploy the website - I usually use a module called mod_pagespeed on my apache servers to minify responses and do other optimisation stuff.

Cloudflare Pages has an option for minifying the response payload within their dashboard at: https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization (see https://www.answeroverflow.com/m/1116304720353579068).

I think it may be worth turning Auto Minify on, and using the other optimisation tools of Cloudflare to improve response/rendering times on the website.

digitalsparky commented 1 month ago

In this case, Hugo already has a minify step, looks like all the CSS/JS is already being minified, so all @ChrisTitusTech has to do is build using the --minify flag in order to get HTML minified as well.

digitalsparky commented 1 month ago

@ChrisTitusTech please change the hugo build command to:

HUGO_ENV="production" hugo --gc --minify .
ChrisTitusTech commented 1 month ago

Thanks for letting me know about this. I missed the hugo build command to minify it. It's added now and it should now be properly minifying things.