Post by federicoch » Tue Oct 02, 2012 9:45 am

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 !

Newbie

Posts

Joined
Sat May 19, 2012 7:06 am

Post by i2Paq » Tue Oct 02, 2012 6:48 pm

I will give it a go tonight!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by philbydevil » Wed Oct 10, 2012 8:13 pm

Before:
Picture 2.png

Picture 2.png (26.13 KiB) Viewed 20503 times

After:
Picture 3.png

Picture 3.png (26.64 KiB) Viewed 20503 times

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

I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1


User avatar
Active Member

Posts

Joined
Fri Dec 03, 2010 5:20 am

Post by Discwog » Fri Nov 02, 2012 5:50 am

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 20174 times

Before SmartOptimizer
4DG_Speed2.png

4DG_Speed2.png (14.92 KiB) Viewed 20174 times

After SmartOptimizer - 1st run
4DG_Speed3.png

4DG_Speed3.png (15.02 KiB) Viewed 20174 times

After SmartOptimizer - 2nd run

Newbie

Posts

Joined
Sat Apr 09, 2011 2:22 am

Post by Bart » Mon Dec 10, 2012 9:06 pm

Is it possible to install Smartoptimizer in the subfolder "store"?

www.mydomain.com/store

New member

Posts

Joined
Tue Feb 14, 2012 6:49 pm

Post by Bart » Mon Dec 10, 2012 9:12 pm

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???

New member

Posts

Joined
Tue Feb 14, 2012 6:49 pm

Post by Bart » Wed Dec 12, 2012 4:28 pm

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/

New member

Posts

Joined
Tue Feb 14, 2012 6:49 pm

Post by ITECHINN » Thu Dec 20, 2012 5:48 pm

Hello,

Before optimize
optimizer-once.png

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

After optimize
optimizer-sonra.png

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

What is the problem ? :(

Newbie

Posts

Joined
Thu Dec 20, 2012 5:39 pm

Post by rdvapors » Sat Mar 02, 2013 1:18 am

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

Attachments

webpagespeed.png

webpagespeed.png (6.72 KiB) Viewed 18425 times


New member

Posts

Joined
Thu Dec 13, 2012 11:29 pm

Post by madimar » Sat Mar 02, 2013 2:34 pm

Interesting topic! Should it work for all opencart versions?

M


Sent from my iPad using Tapatalk

-----------------------------------------------------------------------
My last mods: Partita IVA e CF | Pro EU VAT Number | Sales Agents | Pricelist Pro
-----------------------------------------------------------------------


User avatar
Active Member

Posts

Joined
Thu Sep 24, 2009 6:27 pm


Post by kabatza1 » Thu Mar 21, 2013 4:03 am

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.

Newbie

Posts

Joined
Wed Jun 13, 2012 1:08 am

Post by shukshyna » Thu Mar 28, 2013 6:45 am

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))

Newbie

Posts

Joined
Wed Jan 02, 2013 9:53 pm

Post by rdvapors » Sat Mar 30, 2013 2:09 am

I might add, that smartoptimizer is installed as well. Adding the .htaccess only made it work better.

New member

Posts

Joined
Thu Dec 13, 2012 11:29 pm

Post by ralphstirrat » Wed May 01, 2013 5:43 pm

Excellent addon thankyou! ;D

http://colbrook.co.uk


Active Member

Posts

Joined
Wed Aug 29, 2012 7:53 pm

Post by Jacqueline » Mon May 27, 2013 12:16 pm

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?

New member

Posts

Joined
Sun Jun 03, 2012 12:05 am

Post by Cleo » Mon May 27, 2013 4:03 pm

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

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Jacqueline » Mon May 27, 2013 4:28 pm

why do i have an error of smartoptimizer error;Invalid file name () ???

New member

Posts

Joined
Sun Jun 03, 2012 12:05 am

Post by Cleo » Mon May 27, 2013 4:35 pm

Did you upload the smartoptimizer folder and set the right permission to it's cache folder?

Also delete the .htaccess in that folder

Cleo
Last edited by Cleo on Thu Oct 31, 2013 4:57 pm, edited 1 time in total.

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am

Post by Jacqueline » Mon May 27, 2013 4:38 pm

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.

New member

Posts

Joined
Sun Jun 03, 2012 12:05 am

Post by Cleo » Mon May 27, 2013 4:47 pm

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

Opencart v1.5.4.1 fr/en
Theme: Custom
vqmod-2.6.0
PHP: 7.3 (ea-php73)


User avatar
Active Member

Posts

Joined
Wed Mar 09, 2011 5:19 am
Who is online

Users browsing this forum: No registered users and 4 guests