Page 1 of 4

Speed Up OC 1.5.4.1 FREE!

Posted: Tue Oct 02, 2012 9:45 am
by federicoch
Hello I integrated a little tool to speed up OC it's works GREAT !
First test the speed of your web http://gtmetrix.com/dashboard.html and save the results

Step 1: Download smartoptimizer.zip , extratc it, and upload into the root folder
EX: root/public_html/smartoptimizer/
set chmod 777 the folder Cache
EX: root/public_html/smartoptimizer/cache/
Step 2 :Open .htaccess from root/public_html/, and add this code at the end :

Code: Select all

<IfModule mod_expires.c>
	<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">
		ExpiresActive On
		ExpiresDefault "access plus 10 years"
	</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
	RewriteEngine On
	
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1
	
	<IfModule mod_expires.c>
		RewriteCond %{REQUEST_FILENAME} -f
		RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1
	</IfModule>

	<IfModule !mod_expires.c>
		RewriteCond %{REQUEST_FILENAME} -f
		RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico))$ smartoptimizer/?$1
	</IfModule>
</IfModule>
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">
	FileETag none
</FilesMatch>



Step 3: Test It ! http://gtmetrix.com/dashboard.html you will notice a BIG CHANGE !

You can edit the baisc config from smartoptimizer/config.php



If this was an usefull post commnet your results !

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Tue Oct 02, 2012 6:48 pm
by i2Paq
I will give it a go tonight!

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Wed Oct 10, 2012 8:13 pm
by philbydevil
Before:
Picture 2.png

Picture 2.png (26.13 KiB) Viewed 18106 times

After:
Picture 3.png

Picture 3.png (26.64 KiB) Viewed 18106 times

The "grades" are better, but the "load time" is longer... what do you make of this?

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Fri Nov 02, 2012 5:50 am
by Discwog
My guess is that the cache hadn't had time to get "filled". I had a similar result on my first test after installation. However, on subsequent runs it was markedly better.
4DG_Speed1.png

4DG_Speed1.png (14.88 KiB) Viewed 17777 times

Before SmartOptimizer
4DG_Speed2.png

4DG_Speed2.png (14.92 KiB) Viewed 17777 times

After SmartOptimizer - 1st run
4DG_Speed3.png

4DG_Speed3.png (15.02 KiB) Viewed 17777 times

After SmartOptimizer - 2nd run

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon Dec 10, 2012 9:06 pm
by Bart
Is it possible to install Smartoptimizer in the subfolder "store"?

www.mydomain.com/store

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon Dec 10, 2012 9:12 pm
by Bart
And... federicoch. You say: "I integrated a little tool to speed up OC it's works GREAT !"

Question: Did you in any way adapt the utility of Ali Farhadi to OpenCart???

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Wed Dec 12, 2012 4:28 pm
by Bart
The SmartOptimizer-cache is filled, but I see no improvement in Page Speed, YSlow and Loadtime.

In my case OC is in the subfolder "mydomain/shop"

Is it possible that the htaccess file needs an extra rule:
RewriteBase /shop/

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Thu Dec 20, 2012 5:48 pm
by ITECHINN
Hello,

Before optimize
optimizer-once.png

optimizer-once.png (66.24 KiB) Viewed 17052 times

After optimize
optimizer-sonra.png

optimizer-sonra.png (68.74 KiB) Viewed 17052 times

What is the problem ? :(

[Solved] SmartOptimizer with no Admin access

Posted: Sat Mar 02, 2013 1:18 am
by rdvapors
Some individuals have experienced a significant increase in the web site performance and some have not. I was one of them then did not get past a B grade. However, I have found many enhancements that helped me just by using the .htaccess file. I have also solved the problem of not being able to access your admin area.

By using this .htaccess file I have 99/100 score with gtmetrix and a page load time of .5 seconds.

You are free to use this of course, but you should rename your original .htaccess before you upload this one.

The final item that needs to be taken care of is deleting the .htaccess file in the smartoptimizer file. This has a conflict with rendering your page correctly with .css files.

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

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

<FilesMatch ".(js|css)$">
Header append Cache-Control "private"
</FilesMatch>
<FilesMatch "\.(gif|jpe?g|png)$">
Header set Cache-Control "public"
</FilesMatch>

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 10 days"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/plain "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-icon "access plus 1 year"
</IfModule>
## EXPIRES CACHING ##

##SmartOptimizer##
<IfModule mod_expires.c>
   <FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">
      ExpiresActive On
      ExpiresDefault "access plus 10 years"
   </FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
   RewriteEngine On
   
   #RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1
   
   <IfModule mod_expires.c>
      RewriteCond %{REQUEST_FILENAME} -f
      RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1
   </IfModule>

   <IfModule !mod_expires.c>
      RewriteCond %{REQUEST_FILENAME} -f
      RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico))$ smartoptimizer/?$1
   </IfModule>
</IfModule>
<FilesMatch "\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt|ico)$">
   FileETag none
</FilesMatch>
##SmartOptimisre##

# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does 

run in ie. / becomes /shop/ 

RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
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 any of the following settings, restore 

the # as this means your host doesn't allow that.

# 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. 

This may work to disable it:
# php_flag register_globals off

# 2. If your cart has magic quotes enabled, This may work to disable it:
# php_flag magic_quotes_gpc Off

# 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but 

you can try
# php_value upload_max_filesize 999M

# 4. set max post size. uncomment this line if you have a lot of product options or are getting 

errors where forms are not saving all fields
# php_value post_max_size 999M

# 5. set max time script can take. uncomment this line if you have a lot of product options or 

are getting errors where forms are not saving all fields
# php_value max_execution_time 200

# 6. set max time for input to be recieved. Uncomment this line if you have a lot of product 

options or are getting errors where forms are not saving all fields
# php_value max_input_time 200

# 7. disable open_basedir limitations
# php_admin_value open_basedir none

Speed Up OC 1.5.4.1 FREE!

Posted: Sat Mar 02, 2013 2:34 pm
by madimar
Interesting topic! Should it work for all opencart versions?

M


Sent from my iPad using Tapatalk

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Thu Mar 21, 2013 4:03 am
by kabatza1
I'm a bit disappointed... why not listening to the guy who made it and DONT use it in the backend??
http://farhadi.ir/projects/smartoptimizer/

Prevent this script from the admin like this:

Code: Select all

#what this do?
#if admin, or admin/ or admin/whatever is requested, stop here
RewriteRule ^(admin)($|/) - [L]
Other than that, and given that his creator states that he is not too happy with it, the script works fairly good in my opinion.
I advise to disable the script's error reporting after testing... even small errors are scary things for customers!

Now let's wait and see how it will perform under load.

Re: [Solved] SmartOptimizer with no Admin access

Posted: Thu Mar 28, 2013 6:45 am
by shukshyna
rdvapors wrote:Some individuals have experienced a significant increase in the web site performance and some have not. I was one of them then did not get past a B grade. However, I have found many enhancements that helped me just by using the .htaccess file....
I have had a problem with my 1.5.4 front end design collapsed after installing the original smartoptimizer (though on 1.4.9 it worked beautifully). I tried the suggested by this nice guy and now it works perfectly well :) I did not get an A mark (I still have much work ahead) but still the difference is very big. Thanks rdvapors! (if this is your real name. jk))

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Sat Mar 30, 2013 2:09 am
by rdvapors
I might add, that smartoptimizer is installed as well. Adding the .htaccess only made it work better.

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Wed May 01, 2013 5:43 pm
by ralphstirrat
Excellent addon thankyou! ;D

Re: [Solved] SmartOptimizer with no Admin access

Posted: Mon May 27, 2013 12:16 pm
by Jacqueline
rdvapors wrote:
You are free to use this of course, but you should rename your original .htaccess before you upload this one.
what do you mean by renaming the original .htaccess before uploading your version? Why is there a need to rename?

I have read from a post that said ''Warning! If you set a far future expiry date for something and then update one of those files, you must change the name of the file for the browser to re-fetch it.''

won't there be errors, in the sense of loopholes that some files may not be able to find the .htaccess (for example) if we renamed it?

Can we just reupload the .htaccess we have previously backup and insert your code?

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon May 27, 2013 4:03 pm
by Cleo
Can we just reupload the .htaccess we have previously backup and insert your code?
That's what I did just after the symlink and so far I didn't have any problem!

Cleo

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon May 27, 2013 4:28 pm
by Jacqueline
why do i have an error of smartoptimizer error;Invalid file name () ???

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon May 27, 2013 4:35 pm
by Cleo
Did you upload the smartoptimizer folder and set the right permission to it's cache folder?

Also delete the .htaccess in that folder

Cleo

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon May 27, 2013 4:38 pm
by Jacqueline
Cleo wrote:Did you upload the smartoptimizer folder and set permission to 775 or 777 to it's cache folder?

Also delete the .htaccess in that folder

Cleo

Hi cleo, appreciate the reply.

I have set 777 permission to cache folder.

Also deleted the .htacess in that folder as well.

Re: Speed Up OC 1.5.4.1 FREE!

Posted: Mon May 27, 2013 4:47 pm
by Cleo
Hum... don't know what else to say :(

I know when I first install it I had a few error in the admin/setting/error.log so I cleared my system cache, vqmod cache and then everything went fine!

But I installed it only tonight so I will go and check if I get any more error :crazy:

Try that and if you still get error maybe someone else will reply!

Good luck

Cleo