Any thoughts on gZIP compression and Cs-cart?

Hello Moka,


[quote name=‘moka’]It breaks the javascript on my homepage…:([/QUOTE]



Try to do my advice for your javascript scripts:



[url]http://forum.cs-cart.com/showthread.php?p=66487#post66487[/url]





Lee Li Pop

I managed to put an exception on the js file in my htaccess, but for some reason when I install add the original smartoptimizer code or edited code in the htaccess file, nothing can find my site (netrenderer, browsershots, pingdom, etc.).



I can see my site and I can also see the effects if I add in the exception line and we are still getting orders. Cache file in the smartoptimizer has been cleared.



any ideas why this is?

I just installed smartoptimizer and had some comments:


  1. When I put this in my cs-cart directory public_html/store/smartoptimizer and edited the .htaccess file in public_html/store it broke my site. None of the style sheets would load, etc.


  2. I moved my smartoptimizer folder to the root public_html and edited the .htaccess file there and the site loaded correctlu


  3. It seems to me that the site is running much faster, but the smartoptizmer/cache folder is empty (folder has the 777 permissions). How do I know if it is actually working or if I’m just seeing what I want.


  4. Should I notice the decrease in html calls, size, etc immediately on the analyzer? Is there a way to check if the compression is actually happening.?



    Like I said, the site def FEELS faster.



    Thanks,



    Joe

The smartoptimizer folder should be in the same directory as your CS-Cart store files.


[QUOTE]3. It seems to me that the site is running much faster, but the smartoptizmer/cache folder is empty (folder has the 777 permissions). How do I know if it is actually working or if I’m just seeing what I want[/QUOTE]



If you have this setup properly, then as various pages of your site are visited, they should be cached and added immediately to your smartoptimizer/cache folder

Also, try adding this to the very top of your .htaccess file in your CS-cart folder:




ExpiresActive On
ExpiresDefault "access plus 10 years"



RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1


RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1



RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$
smartoptimizer/?$1



FileETag none

Struck, thanks for the post.



Clearly I don’t have it setup correctly, The code above matches what I have placed in my .htaccess file. I have tried placin the code:



-public_html/.htaccess Beginning of the file

-public_html/.htaccess End of the file

(moved the smartoptimizer folder to public_html/store at this point, per your suggestion)

-Store/.htaccess Beginning of the file

-Store/.htaccess End of the file

-Store/.htaccess Middle of the file right after Directory Index command



None of these reduced my score in YSlow or added anything to the cache folder(despite a lot of browsing). Furthermore, all three scenarios where the file was in my store directory broke IE. I was able to explore freely in firefox with no problem, but IE loads with no style sheet whatsoever.



The installation instructions are quite simple, I have no clue why I am failing here.



Thanks,

Joe

What’d you do? :smiley:



Yeah, you should see your smartoptimizer/cache folder start to fill up immediately.



Interesting that you say it displays fine in FF but not in IE…



Maybe try putting everything back to how I explained, then turn off the IE page cache feature.



Clear the contents of your var/cache folder in your cs-cart install, then give it another try. :wink:



Also, you may want to triple check your permissions setup for smartoptimizer, I have ours set as follows:

All folders within smartoptimizer = 755

All files within smartoptimizer = 644

Boom goes the dynamite! That’s a wrap, haha. Worked like a charm.



Not that I’m complaining, but no clue why it’s working. I had been hitting the IE developer mode, clear cache button before refreshing anyway, but it wasn’t until I turned off IE caching did things in the smartoptimizer cache folder start to appear.



IE is now blazing fast. I turned off caching in FF too, and I am very surprisd that it’s actually quite slower than IE. I’ve turned caching back on in IE and it has continued to work without breaking the CSS like before.



My YSlow statistics are now at only a handful of requests like the other users on this page (instead of the 50+) so it’s definitely working.



Anyway, thanks a ton man.

-Joe

Awesome, enjoy!

Awesome stuff Struck, #44 & #45 just made my page speed on GTmetrix go from C to A! :slight_smile: Tweaking more…

I’m wondering, with CS-cart 2.12, would installing smartoptimizer still make such a difference?

Hello Flow,


[quote name=‘Flow’]I’m wondering, with CS-cart 2.12, would installing smartoptimizer still make such a difference?[/QUOTE]



For sure, Yes!



In fact, every website needs SmartOptimizer.





Lee Li Pop

Wow that was easy! Installed it in 1 minute and runs like a charm. Site is so much faster I can hardly believe it!



THANKS!!! :smiley: :smiley: :smiley:

It worked well for my site, once I figured it out. Load times went from 7.7 to 4.3.



Thanks for the tip!

And now, Ladies and Gentlemen, here is Step 1:



Speed Up Your CS-Cart eCommerce Website - Gzip - Step 1





Lee Li Pop

[quote name='NicheBuilder' timestamp='1258895856' post='61697']

@ All -



It was actually very simple -



1 - Upload and decompress the smartoptimizer archive folder to the root of your domain. (Should resolve to: yourdomain.com)



2 - Open your root htaccess and on the top line, paste the following code:




ExpiresActive On
ExpiresDefault "access plus 10 years"



RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1


RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(js|css|html?|xml|txt))$ smartoptimizer/?$1



RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1



FileETag none




3 - Make sure the yourdomain.com folder has 777 permissions.



4 Enjoy…

[/quote]



I first pasted this before the DirectoryIndex index.html index.php in htaccess and it broke my checkout style. So I added it at the very bottom and now it worked! Site went from 77% (74% YSLOW) to 89% (81% YSLOW) !

[quote name='usnswcc' timestamp='1310872497' post='117458']

I first pasted this before the DirectoryIndex index.html index.php in htaccess and it broke my checkout style. So I added it at the very bottom and now it worked! Site went from 77% (74% YSLOW) to 89% (81% YSLOW) !

[/quote]



Nevermind it actually breaks my entire site… still trying to figure out where to put the code in htaccess or why it breaks my site completely. Images and text are everywhere, design goes away…

[quote name='kogi' timestamp='1258888959' post='61695']

Installation Instructions



------------------------


  1. Upload smartoptimizer folder to your website.


  2. “smartoptimizer/cache” folder should be writable (in most cases 777 permission is needed).


  3. Upload .htaccess file on the folder that smartoptimizer folder is placed, if there is no another htaccess file currently.



    Otherwise, Copy content of SmartOptimizer htaccess file and paste it inside your current htaccess at the beginning of the file.


  4. It's ready. Enjoy it.

    [/quote]



    I have followed the instructions here but am getting now getting a 500 error

    after installing Smart Optimizer. Anyone have any ideas how I might fix this?

    CS-Cart was working fine before Smart optimizer but after editing the .htaccess

    file I get a 500 error. The same error occurs when I navigate directly

    to the smart optimizer folder as well.

Inside the SO folder there is a .htaccess file. Most of us have had to remove this file to get SO to work. I'd probably start there. If it still doesn't work than I'd make sure your main .htaccess file is correct.



Hope that helps,



Brandon

[quote name='brandonvd' timestamp='1316371001' post='121863']

Inside the SO folder there is a .htaccess file. Most of us have had to remove this file to get SO to work. I'd probably start there. If it still doesn't work than I'd make sure your main .htaccess file is correct.



Hope that helps,



Brandon

[/quote]



Brandon,



Thanks for your reply. I did remove .htaccess in the so folder. I also as install instructions

state added the below to my Cs-Cart .htaccess file. But still get the 500 error. Any other ideas?



php_flag zlib.output_compression Off

php_flag output_buffering Off

php_value output_handler NULL



UPDATE: I replaced everything in my .htaccess file and added the code below which i found in another post on here somewhere. This fixed my issues and SO appears to be working great now.


```php

#php_flag zlib.output_compression Off

#php_flag output_buffering Off

#php_value output_handler NULL



DirectoryIndex index.html index.php











SetOutputFilter DEFLATE



















ExpiresActive On



ExpiresDefault “access plus 10 years”















RewriteEngine On







RewriteCond %{REQUEST_FILENAME} !-f



RewriteCond %{REQUEST_FILENAME} !-d



RewriteRule ^(..(js|css))$ smartoptimizer/?$1











RewriteCond %{REQUEST_FILENAME} -f



RewriteRule ^(.
.(js|css|html?|xml|txt))$ smartoptimizer/?$1













RewriteCond %{REQUEST_FILENAME} -f



RewriteRule ^(.*.(gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1















FileETag none













RewriteEngine on


Some hostings require RewriteBase to be uncommented


# Example:

# Your store url is http://www.yourcompany.com/store/cart

# So "RewriteBase" should be:

# RewriteBase /store/cart

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !\.(png|gif|ico|swf|jpe?g|js|css)$

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php?sef_rewrite=1 [L,QSA]


RewriteCond %{REQUEST_FILENAME} .*\/catalog\/.*

RewriteCond %{REQUEST_FILENAME} -d

RewriteCond %{REQUEST_FILENAME}/index.html !-f

RewriteRule . index.php?sef_rewrite=1 [L,QSA]



```