The most important step is Gzip as shown in Step 1
The second important step is SmartOptimizer as explained in Step 2
And now, the most difficult to build and test, is the .htaccess.
I bypass minor steps such as Step 4 with so few followers. In fact, I understand you: This Step 4 is too difficult.
So, this step 5 is a “Copy and Paste” code. I can’t do easier!
So, I shortcut my promise to delay the publishing of this third most important step to boost your CS-Cart website.
Why publish it now?
The Christmas season will soon beginning, so, it’s now time to have a full power CS-Cart website.
Remember, I worked and tested for 22 hours non-stop to find this (nearly perfect for me) “.htaccess”. With this .htaccess added to Steps 1 & 2, your website would go up to Yslow! result to ~88, and a PageSpeed result to ~85.
In practice, to get the 2 to 5 last points to get Grade A are hidden in minors steps. However, I will NOT give you, because, they are too difficult to acquire, and are time consuming.
[SIZE=“3”]Therefore, I wish you a merry Christmas![/SIZE]
DirectoryIndex index.html index.php<br />
<br />
<IfModule mod_rewrite.c><br />
RewriteEngine on<br />
# Some hostings require RewriteBase to be uncommented<br />
# Example:<br />
# Your store url is http://www.yourcompany.com/store/cscart<br />
# So "RewriteBase" should be:<br />
# RewriteBase /store/cscart <br />
# RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . index.php?sef_rewrite=1 [L,QSA]<br />
RewriteRule ^(.*\.(js|css))$ smartoptimizer/?$1<br />
</IfModule> <br />
<br />
<IfModule !mod_expires.c><br />
RewriteCond %{REQUEST_FILENAME} -f<br />
RewriteRule ^(.*\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt))$ smartoptimizer/?$1<br />
</IfModule><br />
<br />
<IfModule mod_expires.c><br />
<FilesMatch "\.(ico|gif|jpg|jpeg|png|swf|css|js|html?|xml|txt)$"><br />
ExpiresActive On<br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
</IfModule><br />
<br />
<IfModule mod_headers.c><br />
<FilesMatch \.(css|js)$><br />
Header append Vary User-Agent<br />
Header append Vary Accept-Encoding<br />
Header append Cache-Control private<br />
</FilesMatch><br />
<FilesMatch \.(bmp|png|gif|jpe?g|ico|flv|wmv|asf|asx|wma|wax|wmx|wm|swf|pdf|doc|rtf|xls|ppt|eot|ttf|otf|svg)$><br />
Header append Cache-Control public<br />
</FilesMatch><br />
<FilesMatch \.(js|css|bmp|png|gif|jpe?g|ico|flv|wmv|asf|asx|wma|wax|wmx|wm|swf|pdf|doc|rtf|xls|ppt)$><br />
Header unset ETag<br />
FileETag None<br />
</FilesMatch><br />
</IfModule><br />
<br />
# Turn on Expires and set default to 0<br />
<IfModule mod_expires.c><br />
ExpiresActive On<br />
<FilesMatch \.css$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType text/css A315360000<br />
<FilesMatch \.js$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType text/javascript A315360000<br />
ExpiresByType application/javascript A315360000<br />
ExpiresByType application/x-javascript A315360000<br />
ExpiresByType text/x-js A315360000<br />
ExpiresByType text/ecmascript A315360000<br />
ExpiresByType application/ecmascript A315360000<br />
ExpiresByType text/vbscript A315360000<br />
ExpiresByType text/fluffscript A315360000<br />
<FilesMatch \.(bmp|png|gif|jpe?g|ico)$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType image/gif A315360000<br />
ExpiresByType image/png A315360000<br />
ExpiresByType image/jpeg A315360000<br />
ExpiresByType image/x-icon A315360000<br />
ExpiresByType image/bmp A315360000<br />
<FilesMatch \.(eot|ttf|otf|svg)$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType application/x-font-opentype A315360000<br />
ExpiresByType application/x-font-truetype A315360000<br />
ExpiresByType application/x-font-ttf A315360000<br />
ExpiresByType application/x-font A315360000<br />
ExpiresByType font/opentype A315360000<br />
ExpiresByType font/otf A315360000<br />
ExpiresByType application/vnd.oasis.opendocument.formula-template A315360000<br />
ExpiresByType image/svg+xml A315360000<br />
ExpiresByType application/vnd.ms-fontobject A315360000<br />
ExpiresByType font/woff A315360000<br />
<FilesMatch \.(flv|wmv|asf|asx|wma|wax|wmx|wm)$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType video/x-flv A315360000<br />
ExpiresByType video/x-ms-wmv A315360000<br />
ExpiresByType video/x-ms-asf A315360000<br />
ExpiresByType video/x-ms-asx A315360000<br />
ExpiresByType video/x-ms-wma A315360000<br />
ExpiresByType video/x-ms-wax A315360000<br />
ExpiresByType video/x-ms-wmx A315360000<br />
ExpiresByType video/x-ms-wm A315360000<br />
<FilesMatch \.(swf|pdf|doc|rtf|xls|ppt)$><br />
ExpiresDefault "access plus 10 years"<br />
</FilesMatch><br />
ExpiresByType application/x-shockwave-flash A315360000<br />
ExpiresByType application/pdf A315360000<br />
ExpiresByType application/msword A315360000<br />
ExpiresByType application/rtf A315360000<br />
ExpiresByType application/vnd.ms-excel A315360000<br />
ExpiresByType application/vnd.ms-powerpoint A315360000<br />
</IfModule><br />
FileETag none<br />
<IfModule mod_deflate.c><br />
<FilesMatch "\.(php|html)$"><br />
SetOutputFilter DEFLATE<br />
</FilesMatch><br />
</IfModule><br />
```<br />
<br />
Please, Nota Bene:<br />
<br />
1 - This is NOT my full .htaccess (the missing code is security related, and powerful SEO rules. Sorry, this missing part will be NEVER reveled)<br />
<br />
2 - I do NOT say "My .htaccess is perfect". Nope! It's working fine for me. So, I hopefully it will work fine for you too!<br />
<br />
3 - You can (need) tweak it for your own needs.<br />
<br />
4 - My dozen of intermediary steps to get the few final points (for gaining the Grade A) are so terrible for a human being, that I prefer to NEVER publish them.<br />
[B][SIZE="3"]Now, your CS-Cart website should be faster![/SIZE][/B] [IMG]https://secure.hyves.org/images/smilies/default/smiley_running.gif[/IMG]<br />
<br />
Thanks for reading,<br />
<br />
<br />
Lee Li Pop<br />
<br />
[B][SIZE="3"]PS: Today, I found a freeware who can beat all the expensive "website accelerators" like WEBO, and how to use it for profit. <br />
<br />
Keep in touch with Lee Li Pop speed up channel![/SIZE][/B]
I’m testing with CS Cart at the moment so have just added the .htaccess you provided.[/QUOTE]
[SIZE=“3”]This “.htaccess” performs its best performances coupled with Step 1 and Step 2[/SIZE]
[quote name=‘utilityempire’]
Just a quick question, do you have eAccelerator installed and active on your server?[/QUOTE]
No I don’t, because I’m on a shared.
However, if I could afford a dedicated server or a VPS, I would use Alternative PHP Cache, because it will be included built-in to the core of PHP starting with PHP 6.
Lee Li’s .htaccess should work fine for you. My guess is that you still have the smartoptimizer .htaccess file inside the smartoptimizer folder. Remove it, clear your cache and see what happens.
I did install this .htaccess, but I didn’t notice any difference. My old .htaccess was pretty similar so that is probably why.
I did learn something though. I guess there are two types of yslow. There is a version 1 and a version 2. Apparently [url]http://gtmetrix.com/[/url] uses version 1 and gave me a “B” grade. When I run yslow on Firefox it shows that version 2 is an “A” and version 1 is a “B”.
Either way, I’m pretty happy. I never got that good of grades in school so if I’m getting A’s and B’s for my website than I must be doing something right.
I do appreciate your posts on speeding up the sites though. I did notice that doing things like enabling gzip along with smartoptimizer my site speed really increased.
I guess I missed the flush thing. I might have to take a look at it.
As for combining the JS and CSS files, I thought about it. I decided that upgrading my site is enough work already and I don’t really want to have to make more work for myself. There is no doubt that if I were to combine my CSS files that upgrading would be a huge pain in the neck for me where right now it is only a small pain.
I have kind of looked over the WebPageTest. I know that some simple things like optimizing some of my images will help.
I’d love to find out more about the CDN. For some reason my simple mind can’t figure out exactly how this works. No surprise I guess.
Lee Li, have you had any experience with “Xcache”?? I have been running it for 6 months. In Google Web Master tools my site went from Slow to Fast in the Labs section after I installed it so there is some benefit but I wondered if anyone else had tried it out.