[SOLVED] how to reduce Nextjs Static HTML Export Page size on disk?

Issue

I am using Nextjs Static HTML Export and it’s generating each page (Just HTML Code) with a size of 100kb + on disk.

Is there a way to reduce page size on disk?

Solution

I reduced page size by 10X using gzip in build. It increases build time, but result in smaller files. Add this in build command:

&& gzip -k -6 $(find public -type f)

More info on this can be here

Answered By – Tribe56123

Answer Checked By – Marie Seifert (BugsFixing Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *