How to clear cache on Shopify
Maybe you’ve been customizing your theme code here and there and want to clean up your code because your changes aren’t being reflected on the site.Or maybe you just noticed that your site loads very slowly now after you’ve added some customizations, extensions or images. This is the best time to clear your cache.
You don’t want to have to keep looking for the cause in your code nor do you want your shoppers to have to wait long just to load your website. Both scenarios will cost you time and will end up costing you money.
What is a cache?
A cache is a reserved storage location that collects temporary data to help websites, browsers, and apps load faster. This is basically a place on your or your customers’ hard disk where the browser keeps things it downloaded once ready to go, just in case it’s needed again.
For example, when a website visitor visits your site for the first time, their browser will start to download the images and logos into the cache while displaying it as they are viewing the page. If they visit your website and those pages again, their browser won’t need to download those elements again as they’ve already been saved.
Caches can definitely help pages load faster but it also slows it down once it gets full.
Why you need to clear your cache
Sometimes when you are customizing your code, especially for beginners, you may forget to remove some of the “dirty” code or unnecessary code. You might also not notice which images are still there that don’t need to be on your website anymore and are just causing it to load slower.
Clearing your cache helps in troubleshooting these kinds of problems. It can help increase your Shopify store’s loading time. Sometimes you might also notice that after applying changes to your code, it doesn’t appear right away. Deleting or clearing your cache can help refresh your website.
Another reason why you should clear your cache is so that customers will have the best shopping experience. No customer wants to wait for a long period of time just to buy something because that short amount of time could be spent browsing a competitor store.
How to clear your Shopify cache on Google chrome
To clear your cache on this browser, check the step by step guide below:
For Google Chrome
1: Go to Setting
Click the hamburger menu or settings icon at the upper right corner. When the menu appears, click Settings.
2: Click Show advanced settings
Scroll to the bottom of Settings and click Show advanced settings.
3: Click Clear browsing data
Under privacy, choose Clear browsing data.
4: Choose cached images and files
Select cached images and files. Uncheck the other options to avoid deleting browser history, cookies, and other things you don’t need to clear. You can also set the duration of time in which to clear the cache or choose to clear your cache from the very beginning.
5: Click Clear Data
Click to the clear button at the bottom to clear the browsing data.
How to do browser caching
Some of your pages might only consist of a few files and be small in size such as your Contact and About Us page which may be a total of a few kilobytes. But other pages like your Product page can contain a lot of files that will add up to megabytes.
By browser caching, you are able to store such files locally in the user browser. So what happens now is when a shopper visits your site, it will first take some time to load. But, if they revisit your site or move to a different page, it will be faster as some of your files are already saved locally.
The amount of time to download these elements take less which also means faster loading times.
How to leverage browser caching?
You can implement this on the .htaccess file. You can add the following code at the top:
## EXPIRES CACHING ##
< IfModule mod_expires.c>
ExpiresByType image/jpg “access 1 year”
ExpiresByType image/jpeg “access 1 year”
ExpiresByType image/gif “access 1 year”
ExpiresByType image/png “access 1 year”
ExpiresByType text/css “access 1 month”
ExpiresByType text/html “access 1 month”
ExpiresByType application/pdf “access 1 month”
ExpiresByType application/x-shockwave-flash “access 1 month”
ExpiresByType image/x-icon “access 1 year”
ExpiresDefault “access 1 month”
## EXPIRES CACHING ##
Another way to do this is by using Cache-Control, which helps users to establish the methods and time for a file to be cached. Considered as an HTTP header, it is the best for online sellers to make it like so.
Header set Cache-Control “max-age=604800, public”
Caching is a time-saving way to make the user experience for your customers better but also make things more efficient on your end. We hope you learned something new today. Feel free to get in touch with us to discuss.
Having a Shopify expert help you can also ensure best results. You will also be able to focus on other things because you can be rest assured that someone reliable is working on your pages.
If you need a Shopify expert to customize your Shopify pages, or build, design or set up your new Shopify store, look no further than Webinopoly.
Here at Webinopoly, we create solutions that can help entrepreneurs like you build and expand your online business. We can help you with anything from customizing your pages to making you your own custom theme.
Webinopoly is an Award-Winning Digital Agency and are experts in Design, Setup, Development, and Marketing. Our services range from building your Shopify store to theme customization, website development, migration to Shopify, SEO, and marketing.
Connect with us
If you need building your Shopify website or require eCommerce solutions to be developed, you may call us at 713-805-5888, email us at [email protected], or leave us a message here.
Learn more about Webinopoly
If you’d like to learn more about what we can do or view our portfolio, please click on the links below:
Do you want more traffic?
Hey, I'm Moe Farhat. I'm determined to make your business grow.Join Me Here
He is an author, entrepreneur & founder of Webinopoly & multiple IT companies. Moe has been featured multiple times as one of top Shopify experts, Entrepreneur Magazine says he is a “Shopify Wizard” one of the 100 most brilliant Shopify Experts.Learn More