Post by barnesnet » Thu Oct 14, 2010 9:19 pm

Thank you for some really helpful tips.
I can manage most of the points but would like some help with the first one mentioned “Enable GZipping”

I’m running my site from a shared hosting package (not my own servers) would this be a job for the server admin or is it something I need to implement via scripts etc.
I have an apache handlers menu on my control panel but can not work out how I would use the code given above.
Does this code go in the .htaccess file also?

Code: Select all

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
Many thanks

EDIT:
I think I have worked out that the code above gets posted in your .htaccess / htaccess.txt file. Is this correct?

Simon

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by Moggin » Thu Oct 14, 2010 11:49 pm

barnesnet wrote: Does this code go in the .htaccess file also?

Code: Select all

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
Many thanks

EDIT:
I think I have worked out that the code above gets posted in your .htaccess / htaccess.txt file. Is this correct?

Simon
Yes, that's it. The file must be renamed .htaccess to work.

I also enabled 'compress all content' via this icon in cpanel - mine was disabled by default.
optimise_site.png

optimise_site.png (28.47 KiB) Viewed 9620 times

Hope that helps.

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by barnesnet » Fri Oct 15, 2010 12:03 am

Excellent thank you, just looked and I don’t have that option on my control panel.

Right, time to setup a subdomain then.

Many thanks

New member

Posts

Joined
Sat Oct 02, 2010 6:18 am


Post by Moggin » Fri Oct 15, 2010 12:47 am

Let me know if you have any luck! One problem with an image subdomain is that unless you've got wildcard SSL (or no SSL) - it will throw a security error on the checkout pages. The OP here suggests a change to the config - I presume he means the root config - but there isn't an https option in the root config now? ???

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by mtichenor » Sat Oct 16, 2010 10:30 pm

Okay so i set up a subdomain and have followed the directions and my images no longer appear when I upload the new config files.

It seems so simple and the directions seem straightforward, what could I have missed? (i have redone it a couple of times). I am using vr 1.4.9.1

Code: Select all

define('HTTP_SERVER', 'http://ozarksoffroad.com/admin/');
define('HTTP_CATALOG', 'http://ozarksoffroad.com/');
define('HTTP_IMAGE', 'http://pics.ozarksoffroad.com/');

// HTTPS
define('HTTPS_SERVER', 'http://ozarksoffroad.com/admin/');
define('HTTPS_IMAGE', 'http://pics.ozarksoffroad.com/');

// DIR
define('DIR_APPLICATION', '/home/content/m/t/i/username/html/ozarksoffroad/admin/');
define('DIR_SYSTEM', '/home/content/m/t/i/username/html/ozarksoffroad/system/');
define('DIR_DATABASE', '/home/content/m/t/i/username/html/ozarksoffroad/system/database/');
define('DIR_LANGUAGE', '/home/content/m/t/i/username/html/ozarksoffroad/admin/language/');
define('DIR_TEMPLATE', '/home/content/m/t/i/username/html/ozarksoffroad/admin/view/template/');
define('DIR_CONFIG', '/home/content/m/t/i/username/html/ozarksoffroad/system/config/');
define('DIR_IMAGE', '/home/content/m/t/i/username/html/pics.ozarksoffroad/');

Code: Select all

define('DIR_SYSTEM', '/home/content/m/t/i/username/html/ozarksoffroad/system/');
define('DIR_DATABASE', '/home/content/m/t/i/username/html/ozarksoffroad/system/database/');
define('DIR_LANGUAGE', '/home/content/m/t/i/username/html/ozarksoffroad/catalog/language/');
define('DIR_TEMPLATE', '/home/content/m/t/i/username/html/ozarksoffroad/catalog/view/theme/');
define('DIR_CONFIG', '/home/content/m/t/i/username/html/ozarksoffroad/system/config/');
define('DIR_IMAGE', '/home/content/m/t/i/username/html/pics.ozarksoffroad/');
define('DIR_CACHE', '/home/content/m/t/i/username/html/ozarksoffroad/system/cache/');
define('DIR_DOWNLOAD', '/home/content/m/t/i/username/html/ozarksoffroad/download/');
define('DIR_LOGS', '/home/content/m/t/i/username/html/ozarksoffroad/system/logs/');

Newbie

Posts

Joined
Thu Oct 07, 2010 1:41 am

Post by mtichenor » Thu Oct 21, 2010 4:07 am

Hello..anyone? Bueller?

Newbie

Posts

Joined
Thu Oct 07, 2010 1:41 am

Post by Adrian666 » Sat Oct 23, 2010 5:20 am

please guys i need some help with this I followed the steps but could not get this to work... im not sure which 3rd file you mention in the tutorial i dont see any admin.php ??????????????

User avatar
New member

Posts

Joined
Sat Sep 25, 2010 6:19 am

Post by gmoussa73 » Tue Nov 02, 2010 7:29 am

guys i tried to to the sub-domain method...nothing happened at all....can anyone give us the step by step how to implement that?? i am using v1.4.9.1
i put /images in my root directory and copied the image folder entirely...then created a subdomain : images.mysite.com and modified config.php on both root directory and admin directory.....nothing changed..try to clear cashe also no good......i did it wrong or am i missing a step in here? my shop is very slow loading although there is not much pix , around 77 products but its slow....also if this is going to work...where to change the pix uploading directory to the new images folder created in root??
cheerz..

New member

Posts

Joined
Fri Oct 01, 2010 2:39 am

Post by Adrian666 » Thu Nov 04, 2010 6:04 am

I have fixed this issue at the following thread...
http://forum.opencart.com/viewtopic.php?f=20&t=22096

User avatar
New member

Posts

Joined
Sat Sep 25, 2010 6:19 am

Post by Moggin » Thu Nov 04, 2010 10:51 pm

For page speed fanatics who run their own server, Google have released an Apache module which carries out some of the pagespeed optimisations automatically
http://googlewebmastercentral.blogspot. ... aster.html

Active Member

Posts

Joined
Wed May 05, 2010 4:56 am

Post by fettabachi » Tue Nov 16, 2010 3:28 am

Here's a nice tool you can use to evaluate the compression of your pages. It works with gzip as well as deflate. http://www.gidnetwork.com/tools/gzip-test.php

User avatar
Newbie

Posts

Joined
Tue Aug 17, 2010 10:13 pm

Post by MattW » Thu Nov 18, 2010 2:07 pm

Just done the .htaccess change on mine, and ran some before and after tests (From: Gloucester, UK - IE7 - DSL)

Before:
Load Time
First View 3.592s
Repeat View 2.619s

After:
Load Time
First View 3.532s
Repeat View 0.655s

Image


User avatar
New member

Posts

Joined
Sat Aug 28, 2010 11:37 am
Location - Sheffield

Post by fettabachi » Fri Nov 19, 2010 10:02 am

I tried using a subdomain for my images and everything worked except for the thumbnails used in the shopping cart. Text links appeared where the thumbnails were supposed to be.

Has anyone else experienced this?

Clean install 1.4.8b

Thanks

User avatar
Newbie

Posts

Joined
Tue Aug 17, 2010 10:13 pm

Post by Qphoria » Fri Dec 17, 2010 3:25 am

Skyhigh wrote:I

Caching
This one's really simple and just involves updating your .htaccess file.
Basically all the files your site uses (jpgs, gifs, css, js, etc) need to be able to tell your PC how long they should keep them for before checking for a new file.

If we don't tell the browse a "cache time" then it will get a fresh copy of the file every time....which means more bandwidth usage and getting a 'fresh' version of the site every time - which takes longer to load.

Google recommends (or Page Speed does) that files are cached at least a month - to be honest, this is a bit of a long time but...I'm sticking with what Google tell me ;)
Although I've left JS and CSS at 24 hours since I'm currently changing the site a lot - if you don't make many changes, set it to at least a month.
(PageSpeed and other optimisation tools through a fit about a 'small' 24-hour cache period, but hey...


Before on a 'fresh view' my site was transferring 400kb. On the second view it was still transferring 300kb.
After changing the htaccess, it dropped to 80kb.


So add this to your htaccess file :

Code: Select all


# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
 
# Set up caching on media files for 5 weeks
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A3024000
Header append Cache-Control "public"
</FilesMatch>
 
# Set up caching on media files for 5 weeks
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A3024000
Header append Cache-Control "public"
</FilesMatch>
 
# Set up 1 day caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A86400
Header append Cache-Control "proxy-revalidate"
</FilesMatch>
 
# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
Added this to my htaccess... Didn't see much diff but figured it might shave a few seconds off anyway. Thought it was working find but it seems that one of these parameters was making the download link for downloads on the site try to download the "index.php" file. I removed the whole thing and it went away.. haven't tested them out individually yet. Oddly I did not see this problem when I tried downloading from the site. Only other customers were having issues. Anyways... just FYI

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bewitching » Fri Feb 04, 2011 6:14 am

Using the Enable GZipping, and Caching mods mentioned I went from a score of 77 to a score of 84 on WebPagetest.org !!!
NICE !
Thank you SkyHigh !!!

Considering OpenCart once again :)


User avatar
New member

Posts

Joined
Fri Jan 28, 2011 10:59 pm

Post by deludeddonny » Wed Feb 16, 2011 9:35 pm

OK I got the image subdomain thing to work, and it made a HUGE difference,

I am now trying to add the gzip & cache thing...

This is my .htaccess

Code: Select all

# 1.To use URL Alias you need to be running apache with mod_rewrite enabled. 

# 2. In your opencart directory rename htaccess.txt to .htaccess

# For any support issues please visit: http://www.opencart.com

Options +FollowSymlinks

# Prevent Directoy listing 
Options -Indexes

# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini)">
 Order deny,allow
 Deny from all
</FilesMatch>

# SEO URL Settings
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

### Additional Settings that may need to be enabled for some servers 
### Uncomment the commands by removing the # sign in front of it.
### If you get an "Internal Server Error 500" after enabling, then restore the # as this means your host doesn't allow that.

<IfModule mod_deflate.c>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>

# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 5 weeks
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A3024000
Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 5 weeks
<FilesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A3024000
Header append Cache-Control "public"
</FilesMatch>

# Set up 1 day caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A86400
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>
but I get 500 error... any ideas?

According to my info.php I should have gzip & deflate support...
Last edited by deludeddonny on Wed Feb 16, 2011 9:46 pm, edited 3 times in total.

Newbie

Posts

Joined
Wed Feb 02, 2011 9:00 am

Post by deludeddonny » Wed Feb 16, 2011 9:40 pm

banane wrote:why not to add

Code: Select all

<?php flush(); ?>
between </head> and <body>?
it speeds up the rendering because sends asap the first part of the page
more info here: http://developer.yahoo.com/performance/rules.html#flush
Which file should this be added to?

Newbie

Posts

Joined
Wed Feb 02, 2011 9:00 am

Post by glolar » Thu Mar 03, 2011 4:57 pm

I would like to post my results before and after trying some of the suggested optimizations:

With no optimization, Score: 75/100

First View: 5.391s
Repeat View: 3.211s

With GZipping enabled, Score: 78/100

First View: 5.232s
Repeat View: 3.548s

After caching added, Score: 82/100

First View: 5.230s
Repeat View: 1.643s

I tried creating a subdomain for my images, but when I did, none of my images would display. Can someone tell me what I am doing wrong?

My new subdomain is:

images123.glolar.com (with root directory of home/public_html/images123)

Here is my config.php with new lines added (old lines are commented out):

// DIR
// define('DIR_IMAGE', '/home/glolar/public_html/store/image/');
define('DIR_CONFIG', '/home/glolar/public_html/store/system/config/');

Here is my admin/config.php with new lines added (old lines are commented out):
// HTTP
// define('HTTP_IMAGE', 'http://glolar.com/store/image/');
define('HTTP_IMAGE', 'http://images123.glolar.com/');

// DIR
// define('DIR_IMAGE', '/home/glolar/public_html/store/image/');
define('DIR_IMAGE', '/home/glolar/public_html/images123/');

I copied my images from the old /store/image/data folder to the new /data folder, and my cache/data folder was created by OpenCart, and my cached images are in there, but I am getting no images when I view my OpenCart pages. Can someone tell me what I am missing here?

Thanks in advance.

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA

Post by speedingorange » Fri Mar 11, 2011 8:18 pm

Can someone explain why you cant just use the image directory already within opencart as a subdomain?

surely that way you could access it as

Code: Select all

http://www.mystore.com/image
and
http://image.mystore.com/
Or am I completely wrong? (more than likely that I am wrong. Could someone explain why :) )

Active Member

Posts

Joined
Tue Feb 23, 2010 7:33 pm

Post by glolar » Tue Mar 15, 2011 9:35 am

I am posting again here, without the stats, so hopefully someone can tell me what I am doing wrong with the image subdomain:

I tried creating a subdomain for my images, but when I did, none of my images would display. Can someone tell me what I am doing wrong?

My new subdomain is:

images123.glolar.com (with root directory of home/public_html/images123)

Here is my config.php with new lines added (old lines are commented out):

// DIR
// define('DIR_IMAGE', '/home/glolar/public_html/store/image/');
define('DIR_CONFIG', '/home/glolar/public_html/store/system/config/');

Here is my admin/config.php with new lines added (old lines are commented out):
// HTTP
// define('HTTP_IMAGE', 'http://glolar.com/store/image/');
define('HTTP_IMAGE', 'http://images123.glolar.com/');

// DIR
// define('DIR_IMAGE', '/home/glolar/public_html/store/image/');
define('DIR_IMAGE', '/home/glolar/public_html/images123/');

I copied my images from the old /store/image/data folder to the new /data folder, and my cache/data folder was created by OpenCart, and my cached images are in there, but I am getting no images when I view my OpenCart pages. Can someone tell me what I am missing here?

Thanks in advance.

Increase Your Child's I.Q.
iPad Wallpapers
Turtle & Tortoise Screen Savers


User avatar
Active Member

Posts

Joined
Thu Jul 29, 2010 12:35 pm
Location - San Diego, CA
Who is online

Users browsing this forum: No registered users and 3 guests