Talk about code obfuscation! You could bury the UDF under 10 includes, 
using a semi-fusebox architecture, delete all the whitespace, then store 
the code in a database, one field stores the code that uses the cached 
query, another field that uses the uncached query, and store the other 
udf in a field called ServerMood, only to requery it live then execute.

So the entire program would end up looking like this on disk:
<cfquery name="query" ...>
SELECT Program, OtherProgram, ServerMood
FROM TheTable
</cfquery>

<cfscript>
evaluate(ServerMood);

if (youFeelLikeIt()) {
   evaluate(query.program);
}
else {
   evaluate(query.otherProgram);
}
</cfscript> 
        

:)

jon

Philip Arnold - ASP wrote:
> Here's the background...
> 
> We've had a little problem with cache recently where the queries never
> get refreshed, mainly because the sites are busy pretty much 24/7
> 
> So, to make it rebuild the cache, we had to come up with a solution
> which worked to rebuild the cache "every now and again"... So, we hit
> upon this idea - use random numbers...
> 
> Anyways, enough wabbling, here's the function - personally I think the
> name is a stroke of genius <g>
> 
> function YouFeelLikeIt()
> {
>       if (RandRange(1,1000) is 1000)
>       {
>               return true;
>       }
>       else
>       {
>               return false;
>       }
> }
> 
> Now, all we do is
> If (YouFeelLikeIt())
> {
>       request.CacheTimeOut=CreateTimeSpan(0,0,0,0);
> }
> Else
> {
>       request.CacheTimeOut=CreateTimeSpan(0,1,0,0);
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to