319: Using a Subdomain to store your images in OpenCart
Google Page Speed recommends using a subdomain to store images that are loaded into your OpenCart store. When a web page tries to load images, scripts, and content they load one at a time. If you have a lot of images, it could dramatically impact your page load speeds. By having the images in a subdomain, they can load at the same time as the site does.
First, you’ll need to create a subdomain for the images in cPanel. During the set up of the subdomain you’ll need to set the document root for the subdomain to the current folder where your images are stored. In this example, we set up the subdomain to images.inmotiontesting.com and pointed it to the existing image folder in the root folder of my OpenCart website.
Now, you have to edit the config.php file in the root of OpenCart:
If you are using HTTPS, you’ll want to change the HTTP settings as well:
If you want to test to make sure your changes have successfully worked, after you have made the changes above load your OpenCart site in a web browser. Then look at the source code to make sure all the image references are pointing to the subdomain. Here's what our new source code looks like:
<div id="logo"> <a href="http://opencart.inmotiontesting.com/index.php?route=common/home"> <img src="http://images.inmotiontesting.com/data/head_logo.gif" title="InMotion Hosting OpenCart Demo " alt="InMotion Hosting OpenCart Demo " /> </a> </div>
If you need further assistance please feel free to ask a question on our support center.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
2014-03-10 8:42 am
Here is present the case when is only one store (base store). But how must made in the the case of multi-stores when we have more stores added as sub-domains or addons domains?
I am very interested about subject, so I waiting your answer much early is possible.
Thank you for advice.
Post a Comment
Do you want to publish a tutorial to our support center?