*

Burton

  • ***
  • 128
Website loading speed improvments
« on: February 09, 2015, 05:39:58 AM »
Hi Phil,

In the past using WordPress I would just add a plugin like W3TotalCache, and Caching, Mimifying, Expires header, and more are easily improved.

Yet with this OdDate script how can I make improvements to page loading times?

I have attached a screen pic from:  http://gtmetrix.com


*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Website loading speed improvments
« Reply #1 on: February 09, 2015, 07:53:32 AM »
Hi Phil,

In the past using WordPress I would just add a plugin like W3TotalCache, and Caching, Mimifying, Expires header, and more are easily improved.

Yet with this OdDate script how can I make improvements to page loading times?

I have attached a screen pic from:  http://gtmetrix.com



Hi Burton,

I would recommend you do as they success in the test results, I got a A at 97% on my osdate test site.

Use the gzip or deflate in the .htaccess works very well.

Compress the CSS file when your finished designing the pages, Compress the main JavaScripts functions.js and enlargeit.js used in the index
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Burton

  • ***
  • 128
Re: Website loading speed improvments
« Reply #2 on: February 09, 2015, 08:11:21 AM »
Hi Phil,

Thank you, all good information,

Ok so I will start with: "deflate in the .htaccess works very well."

Phil what code do I add to my .htaccess to do this?  or do I add code to my .htaccess?

your help appreciated :)

....................

A follow up to that request I went off Google searching "deflate in the .htaccess"

I found this page: http://www.xpertdeveloper.com/2012/04/htaccess-gzip-compression/

I added the code into the .htacces file, and tested it using these 2 sites:

http://www.whatsmyip.org/http-compression-test/

http://www.giftofspeed.com/gzip-test/

both now show:

Uncompressed Page Size: 7.4 KB
Compressed Page Size: 2.4 KB
Savings: 67.9%

Here is the code I added to .htaccess, not sure it is th best, but it is an improvement.

<IfModule mod_deflate.c>
   # force deflate for mangled headers
   # developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
   <IfModule mod_setenvif.c>
     <IfModule mod_headers.c>
       SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
       RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
     </IfModule>
   </IfModule>

   # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
   <IfModule filter_module>
     FilterDeclare   COMPRESS
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
     FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
     FilterChain     COMPRESS
     FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
   </IfModule>

   <IfModule !mod_filter.c>
     # Legacy versions of Apache
     AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
     AddOutputFilterByType DEFLATE application/javascript
     AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
     AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml
     AddOutputFilterByType DEFLATE application/atom+xml
     AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject
     AddOutputFilterByType DEFLATE application/x-font-ttf font/opentype
   </IfModule>
 </IfModule>

.......................................

I then added this code to .htaccess, yet no difference in page loading speed noticed,

<IfModule mod_expires.c>
  ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
  ExpiresDefault                          "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
  ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
  ExpiresByType text/html                 "access plus 0 seconds"

# Data
  ExpiresByType text/xml                  "access plus 0 seconds"
  ExpiresByType application/xml           "access plus 0 seconds"
  ExpiresByType application/json          "access plus 0 seconds"

# RSS feed
  ExpiresByType application/rss+xml       "access plus 1 hour"

# Favicon (cannot be renamed)
  ExpiresByType image/x-icon              "access plus 1 week"

# Media: images, video, audio
  ExpiresByType image/gif                 "access plus 1 month"
  ExpiresByType image/png                 "access plus 1 month"
  ExpiresByType image/jpg                 "access plus 1 month"
  ExpiresByType image/jpeg                "access plus 1 month"
  ExpiresByType video/ogg                 "access plus 1 month"
  ExpiresByType audio/ogg                 "access plus 1 month"
  ExpiresByType video/mp4                 "access plus 1 month"
  ExpiresByType video/webm                "access plus 1 month"

# HTC files  (css3pie)
  ExpiresByType text/x-component          "access plus 1 month"

# Webfonts
  ExpiresByType font/truetype             "access plus 1 month"
  ExpiresByType font/opentype             "access plus 1 month"
  ExpiresByType application/x-font-woff   "access plus 1 month"
  ExpiresByType image/svg+xml             "access plus 1 month"
  ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
  ExpiresByType text/css                  "access plus 1 year"
  ExpiresByType application/javascript    "access plus 1 year"
  ExpiresByType text/javascript           "access plus 1 year"

  <IfModule mod_headers.c>
    Header append Cache-Control "public"
  </IfModule>

</IfModule>
« Last Edit: February 09, 2015, 09:49:13 AM by Burton »

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Website loading speed improvments
« Reply #3 on: February 09, 2015, 10:10:40 PM »
Hi Burton,

Good to see you tried, nice work.  ;)

Just add this to the .htaccess

Code: [Select]
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>

# compress text, html, javascript, css, and xml
<IfModule mod_deflate.c>
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
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE \
text/html text/plain text/xml text/css text/javascript \
application/xml application/xhtml+xml application/rss+xml \
application/javascript application/x-javascript \
image/svg+xml font/opentype application/x-font-ttf
</IfModule>

Test your website now.
« Last Edit: February 09, 2015, 10:13:44 PM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Burton

  • ***
  • 128
Re: Website loading speed improvments
« Reply #4 on: February 10, 2015, 08:32:49 AM »
Hi Phil,

Thank you for that code, deflate in the .htaccess, it works very well :)

Screen pic attached.

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Website loading speed improvments
« Reply #5 on: February 10, 2015, 11:41:07 AM »
Hi Phil,

Thank you for that code, deflate in the .htaccess, it works very well :)

Screen pic attached.

No worries and your welcome.
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: Website loading speed improvments
« Reply #6 on: February 10, 2015, 06:14:03 PM »
thanks, I will try this as well. Besides that I'm using cloudflare which improves the speed of sites in general.
osDate 2.6.5 |PHP/5.4.36  | MySQL: 5.1.73

Re: Website loading speed improvments
« Reply #7 on: June 06, 2015, 04:53:57 AM »
Hi Pharg,

Can we get the full htaccess file pls?

Thanks
mathes

*

Pharg

  • *****
  • 2,071
  • osDate Version: osDate Evo v1.0
Re: Website loading speed improvments
« Reply #8 on: June 06, 2015, 07:47:13 AM »
Hi mathes,

You already have them, it's the .htaccess.txt file you need to rename it to .htaccess 

Then edit the .htaccess  file and change this RewriteBase /osDate_v265/ to RewriteBase /

Then go to the admin SEO Settings and Enable URL Rewriting using mod_rewrite to Yes.

Then add this to the .htaccess file to help speed the website up.
Code: [Select]
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>

# compress text, html, javascript, css, and xml
<IfModule mod_deflate.c>
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
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE \
text/html text/plain text/xml text/css text/javascript \
application/xml application/xhtml+xml application/rss+xml \
application/javascript application/x-javascript \
image/svg+xml font/opentype application/x-font-ttf
</IfModule>
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35