• OzzModz is no longer taking registrations. All registrations are being redirected to Snog's Site
    All addons and support is available there now.

Quick and easy way to leverage browser caching of static assets.

.htaccess

I have no idea how to create one of these or where to put on my site, would someone be kind enough to create one for me with all the stuff ozzy has in his please, and let me know where to put it.

Thanks

#verygrateful
 
Keep in mind .htaccess is not valid for windows servers... Apache Linux is most common one folks would be using for vBulletin installations though. But if you're on a windows server you're SoL on this.
 
[MENTION=3]Max Taxable[/MENTION] How could I in prove on this:
PHP:
 http://www.webpagetest.org/result/140226_5W_E71/
Any tips would great.

Dave
 
[MENTION=3]Max Taxable[/MENTION] How could I improve on this:
PHP:
 http://www.webpagetest.org/result/140226_5W_E71/
Any tips would great.

Dave
Start with these images from this link the WebPageTest provides, you have several that need to be optimized and the site will do that for you.

Images at WebPageTest

Anywhere you see in bold, "Not Progressive" click the link that says "Analyze JPEG" and the site will generate a fully optimized image for you. (The third one it shows) Download that to your computer, re-name it to match the file name it is on your server, and upload to same location allowing overwrite.

Also where you see the grades at the top? Click on the F ones and the site will tell you what the problem is and how to fix.

I test with IE 10 using a fast cable connection, to keep results consistent and to make sure I am testing to latest standards of the new browsers:

Here's your site on that test, this morning: WebPagetest Test Result - Dulles : nirc.co.uk - 02/26/14 16:41:56

Another thing you can do is get rid of the gallery thumbs in sidebar for visitors. Make it so that's only seen when logged in. Also save alot of db queries and calls by making the top 5 stats visible to logged in members only as well. Compensate for the length of the sidebar by displaying more of the "latest threads." Google likes that content much better than thumbnail images anyway.
 
Keep in mind .htaccess is not valid for windows servers... Apache Linux is most common one folks would be using for vBulletin installations though. But if you're on a windows server you're SoL on this.

My vb board is currently on windows server on apache for the last 10 years.I used your cache setup and it works great. For novice user when saving as to htaccess file make sure to add ".htaccess' and save. and then upload to your directory.I do not use any of windows wordpad or note.I use notepad++ from here Notepad++ Home, it saves me alot of headache
 
My vb board is currently on windows server on apache for the last 10 years.I used your cache setup and it works great. For novice user when saving as to htaccess file make sure to add ".htaccess' and save. and then upload to your directory.I do not use any of windows wordpad or note.I use notepad++ from here Notepad++ Home, it saves me alot of headache
Windows OS, with Apache server you mean.

And yes as covered earlier in the thread, the 'htaccess' without the dot before does nothing. File must be named '.htaccess' for it to work.

Glad it's working for you! What test do you use to see if your static assets are indeed being cached now by browsers?
 
Last edited:
Windows OS, with Apache server you mean.

And yes as covered earlier in the thread, the 'htaccess' without the dot before does nothing. File must be named '.htaccess' for it to work.

Glad it's working for you! What test do you use to see if your static assets are indeed being cached now by browsers?

i used the webpagetest link you provided see result before and after.

Before test 1

View attachment 351


before test 2

View attachment 352


After tweak 1

View attachment 353

After tweak 2

View attachment 354

not much but something :)
 
Start with these images from this link the WebPageTest provides, you have several that need to be optimized and the site will do that for you.

Images at WebPageTest

Anywhere you see in bold, "Not Progressive" click the link that says "Analyze JPEG" and the site will generate a fully optimized image for you. (The third one it shows) Download that to your computer, re-name it to match the file name it is on your server, and upload to same location allowing overwrite.

Also where you see the grades at the top? Click on the F ones and the site will tell you what the problem is and how to fix.

I test with IE 10 using a fast cable connection, to keep results consistent and to make sure I am testing to latest standards of the new browsers:

Here's your site on that test, this morning: WebPagetest Test Result - Dulles : nirc.co.uk - 02/26/14 16:41:56

Another thing you can do is get rid of the gallery thumbs in sidebar for visitors. Make it so that's only seen when logged in. Also save alot of db queries and calls by making the top 5 stats visible to logged in members only as well. Compensate for the length of the sidebar by displaying more of the "latest threads." Google likes that content much better than thumbnail images anyway.


Thanks for the reply Max! I'm still only bluffing at all this, really I don't have a glue lol, I will work through all the images to see if I can get it any better. I have the pro version of the DBTech Gallery and I don't see an option for turning off the sidebar for non-members (unregistered) is it possible to turn all these off for unregistered guests?
 
Thanks for the reply Max! I'm still only bluffing at all this, really I don't have a glue lol, I will work through all the images to see if I can get it any better. I have the pro version of the DBTech Gallery and I don't see an option for turning off the sidebar for non-members (unregistered) is it possible to turn all these off for unregistered guests?
You might consult the developer and ask where you would put a vbIF conditional on that mod.
 
Great domain name!

Your site is very heavy on javascript - it alone makes up almost half of your total byte load - 43.6%. You have lots and lots of third party links in your calls and unfortunately these can and do hold up pageloads from time to time and unfortunately do slow down the page cumulatively. You have 179 requests for over 2.1 megabyte (yes, megabyte) load.

You're only getting a C grade for caching of static content and I wonder - are you using my list provided in the OP, or the much more extensive one Ozzy posted? You need to include more file types especially .js in the list.

Lots of your failed caching items are from third party scripts however.

I found only 28kb of savings for you compressing jpg images, because you don't have very many jpg images. Not sure it's worth messing with.

You are heavily monetized and have alot going on with this page and there's not alot that can be done unfortunately.

WebPageTest
 
Great domain name!

Your site is very heavy on javascript - it alone makes up almost half of your total byte load - 43.6%. You have lots and lots of third party links in your calls and unfortunately these can and do hold up pageloads from time to time and unfortunately do slow down the page cumulatively. You have 179 requests for over 2.1 megabyte (yes, megabyte) load.

You're only getting a C grade for caching of static content and I wonder - are you using my list provided in the OP, or the much more extensive one Ozzy posted? You need to include more file types especially .js in the list.

Lots of your failed caching items are from third party scripts however.

I found only 28kb of savings for you compressing jpg images, because you don't have very many jpg images. Not sure it's worth messing with.

You are heavily monetized and have alot going on with this page and there's not alot that can be done unfortunately.

WebPageTest

what do you think about this setup?

PHP:
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A2628000
    ExpiresByType text/richtext A3600
    ExpiresByType image/svg+xml A3600
    ExpiresByType text/plain A3600
    ExpiresByType text/xsd A3600
    ExpiresByType text/xsl A3600
    ExpiresByType video/asf A2628000
    ExpiresByType video/avi A2628000
    ExpiresByType image/bmp A2628000
    ExpiresByType application/java A2628000
    ExpiresByType video/divx A2628000
    ExpiresByType application/msword A2628000
    ExpiresByType application/x-msdownload A2628000
    ExpiresByType image/gif A2628000
    ExpiresByType application/x-gzip A2628000
    ExpiresByType image/x-icon A2628000
    ExpiresByType image/jpeg A2628000
    ExpiresByType application/vnd.ms-access A2628000
    ExpiresByType audio/midi A2628000
    ExpiresByType video/quicktime A2628000
    ExpiresByType audio/mpeg A2628000
    ExpiresByType video/mp4 A2628000
    ExpiresByType video/mpeg A2628000
    ExpiresByType application/javascript A2628000
    ExpiresByType application/x-javascript A2628000
    ExpiresByType application/vnd.ms-project A2628000
    ExpiresByType application/vnd.oasis.opendocument.database A2628000
    ExpiresByType application/vnd.oasis.opendocument.chart A2628000
    ExpiresByType application/vnd.oasis.opendocument.formula A2628000
    ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
    ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
    ExpiresByType application/vnd.oasis.opendocument.text A2628000
    ExpiresByType audio/ogg A2628000
    ExpiresByType application/pdf A2628000
    ExpiresByType image/png A2628000
    ExpiresByType application/vnd.ms-powerpoint A2628000
    ExpiresByType audio/x-realaudio A2628000
    ExpiresByType application/x-shockwave-flash A2628000
    ExpiresByType application/x-tar A2628000
    ExpiresByType image/tiff A2628000
    ExpiresByType audio/wav A2628000
    ExpiresByType audio/wma A2628000
    ExpiresByType application/vnd.ms-write A2628000
    ExpiresByType application/vnd.ms-excel A2628000
    ExpiresByType application/zip A2628000
</IfModule>

#Gzip - compress text, html, javascript, css, 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>
#End Gzip

<ifModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 1 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifModule>

<ifModule mod_headers.c>
  <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
  </filesMatch>
  <filesMatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
  </filesMatch>
  <filesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
  </filesMatch>
  <filesMatch "\\.(xml|txt)$">
    Header set Cache-Control "max-age=216000, public, must-revalidate"
  </filesMatch>
  <filesMatch "\\.(html|htm|php)$">
    Header set Cache-Control "max-age=1, private, must-revalidate"
  </filesMatch>
</ifModule>

<ifModule mod_headers.c>
  Header unset ETag
</ifModule>
FileETag None

<ifModule mod_headers.c>
  Header unset Last-Modified
</ifModule>

<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>
 
what do you think about this setup?

PHP:
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A2628000
    ExpiresByType text/richtext A3600
    ExpiresByType image/svg+xml A3600
    ExpiresByType text/plain A3600
    ExpiresByType text/xsd A3600
    ExpiresByType text/xsl A3600
    ExpiresByType video/asf A2628000
    ExpiresByType video/avi A2628000
    ExpiresByType image/bmp A2628000
    ExpiresByType application/java A2628000
    ExpiresByType video/divx A2628000
    ExpiresByType application/msword A2628000
    ExpiresByType application/x-msdownload A2628000
    ExpiresByType image/gif A2628000
    ExpiresByType application/x-gzip A2628000
    ExpiresByType image/x-icon A2628000
    ExpiresByType image/jpeg A2628000
    ExpiresByType application/vnd.ms-access A2628000
    ExpiresByType audio/midi A2628000
    ExpiresByType video/quicktime A2628000
    ExpiresByType audio/mpeg A2628000
    ExpiresByType video/mp4 A2628000
    ExpiresByType video/mpeg A2628000
    ExpiresByType application/javascript A2628000
    ExpiresByType application/x-javascript A2628000
    ExpiresByType application/vnd.ms-project A2628000
    ExpiresByType application/vnd.oasis.opendocument.database A2628000
    ExpiresByType application/vnd.oasis.opendocument.chart A2628000
    ExpiresByType application/vnd.oasis.opendocument.formula A2628000
    ExpiresByType application/vnd.oasis.opendocument.graphics A2628000
    ExpiresByType application/vnd.oasis.opendocument.presentation A2628000
    ExpiresByType application/vnd.oasis.opendocument.spreadsheet A2628000
    ExpiresByType application/vnd.oasis.opendocument.text A2628000
    ExpiresByType audio/ogg A2628000
    ExpiresByType application/pdf A2628000
    ExpiresByType image/png A2628000
    ExpiresByType application/vnd.ms-powerpoint A2628000
    ExpiresByType audio/x-realaudio A2628000
    ExpiresByType application/x-shockwave-flash A2628000
    ExpiresByType application/x-tar A2628000
    ExpiresByType image/tiff A2628000
    ExpiresByType audio/wav A2628000
    ExpiresByType audio/wma A2628000
    ExpiresByType application/vnd.ms-write A2628000
    ExpiresByType application/vnd.ms-excel A2628000
    ExpiresByType application/zip A2628000
</IfModule>

#Gzip - compress text, html, javascript, css, 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>
#End Gzip

<ifModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType text/html "access plus 1 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifModule>

<ifModule mod_headers.c>
  <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
  </filesMatch>
  <filesMatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
  </filesMatch>
  <filesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
  </filesMatch>
  <filesMatch "\\.(xml|txt)$">
    Header set Cache-Control "max-age=216000, public, must-revalidate"
  </filesMatch>
  <filesMatch "\\.(html|htm|php)$">
    Header set Cache-Control "max-age=1, private, must-revalidate"
  </filesMatch>
</ifModule>

<ifModule mod_headers.c>
  Header unset ETag
</ifModule>
FileETag None

<ifModule mod_headers.c>
  Header unset Last-Modified
</ifModule>

<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>
That's much more extensive but not sure it would have any effect on third party assets.
 
Back
Top