AbanteCart Performance Optimization
Speeding up your website is critical—not just to ranking well with Google, but to keep your bottom-line profits high.
Improving web site performance with Apache .htaccess
Improving web site performance with HTML cache
Shorter proximity amounts to faster load time.
Review your hosting service plan.
Speed optimizations can be easily done with simple .htaccess rules. These rules can make any website faster by compressing content and enabling browser cache. .htaccess is a special configuration file which you should be able to dig up in the root of your server directory. With .htaccess file you can create redirects, rewrite URLs on your website, create password protected directories and other technical things, but you can also use them to improve your site’s page loading speed by taking advantage of some Apache server features.
Compression reduces response times by reducing the size of the HTTP response. It’s worthwhile to gzip your HTML documents, scripts and stylesheets. Gzip compression helps to reduce the amount of data your server needs to send to your users, which in turn speeds up the load time of your site.
You can use the Apache mod_deflate module to compress output from your web site that is sent to client browsers.
When a new visitor enters your website all the files like scripts, CSS styles and images are downloaded – there is no way to avoid it and it naturally produces several requests to your server. But what if this visitor comes back to your website later? We can tell the user’s browser to store these files in its cache; then, when the user returns to your site it will reload the files from the cache rather than downloading them all again.
In order to add browser caching to your website, you will need to set the date for when the cache expires.
Browser cache control is directly related with the header expires date and according to the Apache documentation provides directives to control and modify HTTP request and response headers. Headers can be merged, replaced or removed. You can use this feature by including this code in your htaccess
<IfModule mod_headers.c> Header set Connection keep-alive <filesmatch "\.(ico|flv|jpg|jpeg|png|gif|css|swf)$"> Header set Cache-Control "max-age=2678400, public" </filesmatch> <filesmatch "\.(html|htm)$"> Header set Cache-Control "max-age=7200, private, must-revalidate" </filesmatch> <filesmatch "\.(pdf)$"> Header set Cache-Control "max-age=86400, public" </filesmatch> <filesmatch "\.(js)$"> Header set Cache-Control "max-age=2678400, private" </filesmatch> </IfModule>
How do I enable .htaccess in AbanteCart?
After installing AbanteCart an .htaccess file is already created, but it’s called htaccess.txt and looks like a regular text file. The reason for this? Compatibility. There’s no guarantee that every server that AbanteCart is installed on will support .htaccess’ features. Don’t worry though; most modern servers that are built to support AbanteCart will also support .htaccess
You just need to rename the htaccess.txt file to .htaccess (remember about the dot that comes before “htaccess”!).
Enable HTML pages and blocks caching to get better speed for your pages. HTML cache currently is Beta and can be enabled in System > Settings > System. This is additional caching to regular data caching enabled in system/config.php file
Check with your hosting provider to see whether you have shared or dedicated hosting. A shared hosting account often involves sharing server space with dozens of other companies where website speed is impacted by the number of people using the servers. If this is the case, then it may be time to consider a dedicated plan where you have sole access to the server.