PermaLink Speeding up BlogSphere web performance02/24/2005 04:03 PM

To determine the speed of a site you should NOT use a stop watch. Use a tool like IBM Page Detailer to get exact numbers.
I started by having a look at
one document in my Blog. After deleting the browser cache I had a load time of 5,5 seconds for 53 items with a total size of 155K. The 53 items are a CSS files, JavaScript files and images.

A reload (click on the Permalink, not the reload button in IE) of the page still took 4,35 seconds but the size was just 39K this time. So what happened?

The browser (Internet Explorer in this case) had the whole page in it's cache but hat to contact the server for every item to ask the Domino server if it has been modified. In this example, the Domino server replied to the HTTP GET request by sending the HTTP Reply Header with status code 304, which means "not modified".


- So the cache saves bandwith but validating still takes some time.


Given the theory, that I do not update all design elements in this Domino web application I started to look for cacheable content.

The images seems to be an easy start so I reconfigured Domino to add a HTTP Reply header for all URLs with the following patterns:

*/images/*

*/icons/*

I configured the rule to add the reply header just in case the application didn't and configured 30 days as expiration date.


After a tell http refresh config the server was ready for another test.


On the next page reload the server added the following to his reply:

Expires: Sat, 26 Mar 2005 23:59:59 GMT

This tells the browser to display this icon (in this example) without validating it with the server.


There are still other URLs in BlogSphere responsible for images so I added */2/* which will work for the emoticons in the comments area.


After these changes the loading time is 4,1 seconds for a size of 39K. Still room for improvement.


What remains uncached are CSS files and the JS files. BlogSphere loads them from a view names /0/ so I add another rule for pattern */0/* but this time I configure it to expire after one day because I may want to change the CSS file from day to day.


The result is great: 1,3 seconds for 32K of data and only 6 connections to the server.


Technorati:

This page has been accessed 1981 times. .
Comments:v

1. Christian Brandlehner02/25/2005 16:03:15
Homepage: http://chris.brandlehner.at


Update: The next release of BlogSphere will not need HTTP Response Header configuration in the Domino Directory for the JavaScript files as we added expiraction tagging in the application.
If you want to do that in your own applications too, add a computed text on the form with the following formula, which will set expiration date to tomorrow:
@SetHTTPHeader("Expires";@Adjust(@Now([ServerTime]);0;0;1;0;0;0));""




2. Markus Koller04/07/2005 13:03:36


Firefox and Live HTTP Headers show that for example comments.js is not being cached. Any ideas why? Content-Length should be zero...

http://chris.brandlehner.at/Brandlehner/cab_blog.nsf/comments.js

GET /Brandlehner/cab_blog.nsf/comments.js HTTP/1.1
Host: chris.brandlehner.at
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://chris.brandlehner.at/Brandlehner/cab_blog.nsf/d6plinks/CBRR-69WKNV
If-Modified-Since: Thu, 07 Apr 2005 10:53:40 GMT
Cache-Control: max-age=0

HTTP/1.x 200 OK
Server: Lotus-Domino
Date: Thu, 07 Apr 2005 11:00:43 GMT
Last-Modified: Thu, 07 Apr 2005 11:00:42 GMT
Content-Type: text/javascript
Content-Length: 8896
Expires: Fri, 08 Apr 2005 11:00:42 GMT
Content-Language: en




3. Christian Brandlehner04/07/2005 13:36:23
Homepage: http://chris.brandlehner.at


I have configured comments.js to be cached for 24 hours. Therefore the HTTP-Response is:
Expires: Fri, 08 Apr 2005 11:00:42 GMT

The caching is up to your browser, I would expect your clients is not reloading comments.js until "Fri, 08 Apr 2005 11:00:42 GMT".

In the example given, this has to be the very first request as you are receiving HTTP response code "200", not "302".




4. Markus Koller04/07/2005 13:48:55


It looks like the page always gets a Last-Modified of "now". I never got a 304 response.
I suspect the <Computed Values> in the Notes page are responsible for this. If I delete ALL computed values, the response includes an ETAG and the browser gets 304 the next time.
With computed values on a page, IMHO it will never cache:

GET /Brandlehner/cab_blog.nsf/comments.js HTTP/1.1
If-Modified-Since: Thu, 07 Apr 2005 11:42:40 GMT

HTTP/1.x 200 OK
Date: Thu, 07 Apr 2005 11:43:24 GMT
Last-Modified: Thu, 07 Apr 2005 11:43:23 GMT
Content-Length: 8896
Expires: Fri, 08 Apr 2005 11:43:23 GMT




5. Christian Brandlehner04/08/2005 23:24:01
Homepage: http://chris.brandlehner.at


Good point. I will investigate this behaviour as I think the "Last-Modified" timestamp should NOT affect caching as I want the browser not to check for status 302 but to use the file from the cache without revalidation.




6. Dwight Wilbanks01/03/2006 06:44:20
Homepage: http://www.dwightwilbanks.org


You rock! Thanks, worked like a charm. I've now got a whole list of other uses for these rule docs. With my least aggresive caching it dropped my "New Blog Entry" time from 7-8 seconds down to 4-5 tenths of a second. With agressive caching I was getting 2 tenths of a second load times, but, I really don't mind waiting the extra 2-3 tenths of a second to have cache refreshed every visit.




7. Torch06/21/2006 19:29:39


Sir,

I have been messing around with the Studio Blog / RSS reader off Openntf and seem to be having similar problems to those you experienced. I was wondering if you had managed to overcome them? It seems the project has died and the Project Manager no longer responds to mail.

It may not be the all singing all dancing app it was envisioned to be, but if the basic functionality (read, import, expire, and limit channel items) is more or less all I need. failing a fix are there alternatives you can suggest. I'm 3/4 the way through a project for a client and really have not got the time to attempt a new reader from scratch.

Yours

Torch
South Africa




8. Christian Brandlehner06/22/2006 07:43:10
Homepage: http://chris.brandlehner.at


@7: I never got the BlogReader to work but all I did was an "out of the box" attempt, as I did not have the time to dig into it.




9. Morten Sigsgaard02/04/2009 06:52:35
Homepage: http://msigsgaard.dk


I stumbled across this, and just wanted to share an oppinion on dynamic contents, which in most cases is revalidated with no respect of any expiration.
What im working on is the Quickr CMS which runs on domino;
Instead of expiration, ill use the Last-Modified from server. I believe this is the best approach, maybe combined with max-age/mag-stale on client side requests.

There are N documents in db. Which leaves n iterations for computing Last-Modified - so. Even if browser is notified to use its cache, the server has allready done its job..

What i find to be elegible as the prime solution
Must be toggling a NotesDocument, containing the Last-Modified date - refreshed when a new Document arrives.
So N get very small here; in fact equal to one




Disclaimer
The weblog represent my personal views and comments and does not represent the views of my current or previous employers or customers.
About me
By Category
The BlogRoll
XING advertisement
Proudly Employed By
IBM Lotus Logo
Buy this book
Search
Monthly Archive
2010
2010
2010
2010
2009
2009
2009
2009
2009
2009
2009
2009
2008
2008
2008
2008
2008
2008
2008
2007
2007
2007
2007
2007
2007
2007
2007
2007
2007
2006
2006
2006
2006
2006
2006
2006
2006
2006
2006
2006
2006
2005
2005
2005
2005
2005
2005
2005
2005
2005
2005
2005
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2004
2003
2003
Full Archive
Todays Referrers
Advertisement