Keep an X-Page in Memory

Posted by

Evreybody knows that starting an XPage for the first time takes some time. Using the Notes.ini parameter for preloading the xpages can become slightly difficult if you have a lot of apps.

My solution is quite simple

 
#!/bin/bash 
USERNAME="UserName" 
PASSWORD="Password" 
BASEPATH=/opt/ibm/apps 
LOGIN_URL="https://[SERVER_NAME]/names.nsf?login" 
XPAGES_URL="https://[SERVER_NAME]/[PATH_TO_NSF]/myXpages.xsp"
if [ -f $BASEPATH/last.run ]; then
rm $BASEPATH/last.run
fi
wget --save-cookies cookies.txt --keep-session-cookies --post-data "Username=$USERNAME&Password=$PASSWORD" --delete-after $LOGIN_URL 
wget --load-cookies cookies.txt --delete-after $XPAGES_URL
if [ -f $BASEPATH/cookies.txt ] ; then 
 rm $BASEPATH/cookies.txt 
fi 
touch $BASEPATH/last.run 

Place this file on the server and call it through cron on a regular schedule and your xpages should be always loaded.

As always, use on your own risk.