Using profile documents in a web application

A very quick tip for the non-admins out there today.

I am looking after an app which uses lots of profile documents on the web. It’s not the way I would choose to do things because whenever you change the configuration in a profile document it takes ages (up to half an hour) for the change to be consistently available over HTTP.

To get around that I found a new server console command which makes any change take effect immediately…

tell http clearcaches

It was new for me anyway, hopefully it will help someone else out.

Technorati Tags: Show-N-Tell Thursday

Join the Conversation

8 Comments

  1. Bless You! I was just thinking about this today actually, in the context of “hey, I wonder if a Lotusphere session on Profile Documents would be useful”. I use them all the time, but mostly in Notes client applications, and mostly the values are set using Lotusscript. I’m a little fuzzy on why, but I seem to recall that inappropriate caching is less of a problem than if values are set with @functions.

    This tip might be something to incorporate into a “Configuration Management” panel for a database, whereby certain changes made within that interface would automatically trigger the sending of this console command to the server. You could even prompt the user (power user probably) as to whether the change is needed right away.

    Any sense how big a performance hit you take if you had lots of profile docs that needed to be recached? I would imagine it to be almost trivial – perhaps another second or two loading a web page the first time afterward.

    Like

  2. A good question. The app I am working on only has three profile documents (shortly to have none if I get my way!) and the refresh takes under a second but I guess if you had hundreds of documents for different users it may take a while. To be honest I am just using it in development and probably wouldn’t bother in productions anyway.

    Matt

    Like

  3. Hmmmm. So, if you’re not going to use profile documents for configuration lookups, are you just falling back on dblookups, or some other technique?

    This all got me thinking anew about what the performance considerations were regarding profile docs, and a quick search came up with this compilation of general performance tips from Julian I hadn’t seen before: http://www.nsftools.com/tips/PerfTips.htm“ rel=”nofollow”>http://www.nsftools.com/tips/PerfTips.htm

    So, either I’ve turned you back onto profile docs, or you’re going to tell me about some cool new technique I’ve never tried <img src="http://www.11tmr.com/11tmr.nsf/emoticons/DLYH-5MZVLY/$FILE/smile.gif“>.

    Like

  4. Unfortunately nothing new to offer here. I just choose to take the performance hit of “real” documents for configuration because of the granularity of control and predictability they offer on the web. As a rule of thumb I will try and keep the number of lookups on a form down to three at an absolute maximum, so all of the configuration may be stored in multiple documents but will be accessed by a single lookup and then referenced internally from within the form from then on.

    It’s not something I get religious about and it may not be ground breaking but it’s worked well for me over the years.

    Like

  5. “…it’s worked well for me over the years.”

    Something to be said for that. Another advantage of keeping things “mundane” is that you never know who’s going to work on the app next, and the more transparent the code the better.

    I’m actually wrestling with this question now in the context of planning how to design a relatively straightforward “standard db architecture” (a la Openslice) that would be readily grasped by a novice developer. The question “Should I use profile documents?” depends on how problematic they might be given they are “hidden”, and potentially confusing for that reason. If you say “use them”, then do you count on them to not get corrupted and use @Command([EditProfile]), or do you create “real” documents and then save values to profiles in the querysave? I hear newbies asking “the querywhat?”.

    Fun stuff <img src="http://www.11tmr.com/11tmr.nsf/emoticons/DLYH-5MZVLU/$FILE/wink.gif“>

    Like

  6. Nice tip, thanks. I hate profile documents in web. I never used it because the caché problems. Cool stuff but I stil hate profile docs.

    Like

Leave a comment