> thanks guys, i've chaned now to:
>
[quoted text clipped - 9 lines]
>
> <cfoutput>#customcontent.message#</cfouput>
This logic will have to be run each and every request, since you are not
persisting the data in any way.
> i haven't gone for the session var option as i'm not using session vars (at
> this time) and i've been told to give them a wide berth due to search bots
> creating a new session on each page they visit when they crawl the site and
> apparantly as CF tries to keep track of the resulting numerous session vars in
> memory - apparantly this can result in a loss of performance (any comments on
> that?)
It true that CF will create a session scope for every request that does
not have one created and that it will keep this scope for the time it
has been configured to do so.
But this is not a reason to avoid using it. Just to use it
intelligently and to not fill it with a bunch of unnecessary data just
because it is easy.
On Jul 3, 11:47 am, "happysailingdude" <webforumsu...@macromedia.com>
wrote:
> thanks guys, i've chaned now to:
>
[quoted text clipped - 20 lines]
>
> cheers
A couple of things. As for the bots issue, simply do a bit of
http_agent sniffing then create different cf applications for either
For instance:
<cfif isBot()>
<cfapplication name="appName"
clientmanagement="No"
sessionmanagement="yes"
setclientcookies="yes"
setDomainCookies = "no"
sessiontimeout="#createTimeSpan(0,0,0,30)#"
applicationtimeout="#createTimeSpan(1,0,0,0)#"
clientstorage="cookie">
<cfelse>
<cfapplication name="appName"
clientmanagement="No"
sessionmanagement="Yes"
setclientcookies="Yes"
sessiontimeout="#createTimeSpan(0,2,0,0)#"
applicationtimeout="#createTimeSpan(1,0,0,0)#"
clientstorage = "cookie"
setDomainCookies = "yes">
</cfif>
the isBot() function uses a bit of Regex to sniff out whether the
http_User_agent is a bot:
<cffunction name="isBot" output="false" access="public"
displayname="isBot" hint="I check for bots and return a boolian 1 for
bot" returntype="boolean">
<!--- adapted from http://www.bennadel.com/blog/39-Turning-Off-Session-Management-for-Web-Spiders.htm
--->
<cfset var strTempUserAgent = LCase( CGI.http_user_agent )>
<cfif (NOT Len(strTempUserAgent)) OR
REFind( "bot\b", strTempUserAgent ) OR
REFind( "\brss", strTempUserAgent ) OR
Find("google",strTempUserAgent ) or
Find("yahoo",strTempUserAgent ) or
Find("msn",strTempUserAgent ) or
find("aol",strTempUserAgent ) or
find("baidu", strTempUserAgent) >
<cfreturn true>
<cfelse>
<cfreturn false>
</cfif>
</cffunction>
So basically you give the bot a separate application.cfm with a short
session timeout.
As for the "odd scope" of customer content. Its actually an unscoped
variable that ends up being within the variables scope, that dies with
each page request. Essentially when you call customcontent.message,
you actually are calling variables.customcontent.message.
regards,
larry