Post by nordiczen » Mon Apr 24, 2017 3:14 am

<p>This week I ran a page speed test from both gtmetrix, and google PageSpeed tool (from within my webmaster tools) scores the homepage at 79. I need help to improve my page speed. Server load time test fast, but both tools indicate I need to optimize images, and also seems javascript loading slows the page.</p>
<p>Currently I am on shared hosting/ssd server, and the website runs on OC ver 2.3.0.2, using Journal theme. I have turned on some optimizations from my cPanel, and that did help a bit. Thought that the directives in htaccess would do help compress, but it doesn't seem to compress everything.
I am not a coder, so hoping someone can provide suggestions, and maybe critique the htaccess file (on many levels, such as security, etc)?</p>

Thanks,

Newbie

Posts

Joined
Wed Dec 09, 2015 11:18 am

Post by victorj » Mon Apr 24, 2017 3:30 am

in admin go to journal
open settings, near the bottom you will see system and performance.
make sure you have all options set to on.
Now retest and you will see your score has increased.
(just in case you had not done this yet)

next in your .htaccess

remove all code and add this one

Code: Select all

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

#Rewrite to HTTPS:
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteEngine on
RewriteCond %{HTTP_HOST} ^serenitybridal\.co$ [OR]
RewriteCond %{HTTP_HOST} ^www\.serenitybridal\.co$
RewriteRule ^/?$ "https\:\/\/www\.serenitybridaljewelry\.com" [R=301,L]

RewriteCond %{HTTP_HOST} ^serenitybridal\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.serenitybridal\.net$
RewriteRule ^/?$ "https\:\/\/www\.serenitybridaljewelry\.com" [R=301,L]

FileETag none

# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

Header set Connection keep-alive

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

# compress text, HTML, JavaScript, CSS, and 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

# remove browser bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent

## EXPIRES CACHING ##

<FilesMatch "\.(css|js)$">
Header set Cache-Control "max-age=1728000, public, must-revalidate"
</FilesMatch>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 2 month"
  ExpiresByType image/gif "access 2 month"
  ExpiresByType image/jpg "access 2 month"
  ExpiresByType image/jpeg "access 2 month"
  ExpiresByType image/png "access 2 month"
  ExpiresByType text/css "access 2 month"
  ExpiresByType application/x-javascript "access plus 2 month"
  ExpiresByType text/javascript "access plus 2 month"
  ExpiresByType application/javascript "access plus 2 month"
  ExpiresByType image/x-icon "access plus 12 month"
  ExpiresByType image/icon "access plus 12 month"
  ExpiresByType application/x-ico "access plus 12 month"
  ExpiresByType application/ico "access plus 12 month"
</IfModule>
## EXPIRES CACHING ##

<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>

# 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=extension/feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=extension/feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [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]

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by nordiczen » Mon Apr 24, 2017 7:14 am

@victorj thank you for replying. So that I understand the directives you provided:

1. It will still resolve all pages to https , correct?

2. You are using DEFLATE, instead of gzip directives. In what ways is deflate more effective?

3. The remove browser bugs, was included more than once. Is this a typo?

In Journal, I have already the parts On for speed and perf.

Also, from my speed tests - mentions were made about defer JavaScript, either by async or other method. Somewhere I had read that by defer Javascripts, could possibly cause problems elsewhere? Could you explain this? If I read incorrect, how could I go about implementing this? ** I notice my google analytics script is already async.

Newbie

Posts

Joined
Wed Dec 09, 2015 11:18 am

Post by IP_CAM » Mon Apr 24, 2017 7:40 am

just to mention this, I get an Access Security warning, that this website is not set up
according secure https-Spec's, since does not serve informantion about the Owner of this Site.
it's validated by Comodo CA Limited.

Code: Select all

Diese Website stellt keine Informationen über den Besitzer zur Verfügung.
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by nordiczen » Mon Apr 24, 2017 9:01 am

"Access Security Warning" ? @IP_CAM which browser are you using? I occasionally check myself, using firefox and opera browsers, and do not get a warnings. Google WMT also gives it a go, with no security errors. Very interesting point - will look into it further.

Thanks/ vielen danke

Newbie

Posts

Joined
Wed Dec 09, 2015 11:18 am

Post by IP_CAM » Mon Apr 24, 2017 10:24 am

I use latest Firefox 56.0.1, with activated NoScript.
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 2 guests