Ok il give you some good advice, I do this everytime I have finished building a website and I manage to get my load speed up nearly 20 points on Google page speed insights on some websites. First of all use
https://developers.google.com/speed/pagespeed/insights/ to get a rough mark of where your website is at for mobile and desktop speed. Then this is what I do:
- Make sure you are using compressed images, and only jpgs not pngs for images that don't need to be transparent. There are plenty of tools online to compress images without image quality loss, then when you upload them to your server, if you are using wordpress, install a plugin called "WP Smush", this will losslessly compress your images. (You can use a plugin called "EWW Image Optimizer" after WP Smush too to get more compression from images that WP Smush has missed)
- Enable compression, I always add this to the top of my .htaccess (take a backup first):
## GZIP COMPRESSION ##
[TABLE="align: left"]
[TR]
[TD="align: left"]<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
[/TD]
[/TR]
[/TABLE]
## GZIP COMPRESSION ##
- Ignore (
Eliminate render-blocking JavaScript and CSS in above-the-fold content) - This will pop up on every website and basically means not to include external CSS/JS in your websites head (which would make your source very messy)
- Finally I use w3 Total Cache (take a backup of your website before using this plugin) - for browser, database caching, look for a tutorial on how to configure these options.
- Minify your html, css, js. Now this quite often breaks websites, but seems to be fine for some and will speed them up significantly, by minifying your websites html, css, js, you can use the w3 total cache plugin to do this. Enable minification for html first, then empty your cache, check your website that everything is fine, then do the same for css, then do the same for javascript. Make sure you test your contact forms, etc are all working properly especially with having JS minified.
Note: if you happen to break your website using w3tc, go into your FTP and rename the plugins folder with say a number "9" on the end, this will disable it if you cannot access your website.
There are lots of tutorials for this stuff out there if you get stuck, but these are the things that I do and seems to boost my wordpress sites speed up heaps.
All the best
