Shopify page speed improvements - htaccess, etc

5.1k Views Asked by At

A client has complained that their website is slow, so I'm trying to implement some improvements. The first thing I was going to do was modify their htaccess file but, being that they are using a Shopify system, it doesn't seem possible to do such a thing.

How can I access and modify the .htaccess file for a Shopify website? Or if I can not access .htaccess, how can I enable GZIP compression, Expire / Cache-control, etc.. How can I setup all the things that would normally be setup in an .htaccess file?

2

There are 2 best solutions below

3
On

You cannot DevOps a slow Shopify site.

Shopify is managed by a DevOps team far more skilled than Apache tweakers used to fiddling with that venerable ancient beastess and .htaccess files.

You could tell you client their website is slow most likely (read 90% chance or better) due to poor theme coding. Check their Javascript external service loads. Check their CSS. Their images for optimization. Almost all slow Shopify sites are due to sloppy, incompetent coding of those front-end concerns. Shopify uses a CDN for assets that is global, meaning those in places poorly served by the Internet will remain slow, but for everyone else, things should be fast.

And they know all about compression and caching too. You are likely barking up the wrong tree.

0
On

You cannot edit the .htaccess file in Shopify but you can do some techniques to improve the loading speed like:

  • Remove render-blocking resources
  • Remove unnecessary shopify apps
  • Preload Web Fonts
  • Compress Images
  • Make the images responsive and load only visible images by implementing lazy loading technique and I suggest to use Lazysizes plugin to do both ( responsive images and lazy loading)
  • Preload and minify Js and Css
  • Combine all JS in one file and also for CSS to reduce the number of requests

Shopify Speed Optimization — Step-by-Step Guide