Those are some fine points. I presume that in all cases, you have to
have your webserver not check for the existence of a file before
handing off the request.

 I'm curious about the efficiency argument there. I can see your point
about the webserver not having to look at calls for a js file or css
file or what have you, but the lookup in the url rewriter is usually a
pretty straight forward regex with exclusion rules for file extensions
(css, js, gif, etc). How much overhead do you think that adds? Versus
onmissingtemplate() which will only run when a CF file is requested,
but it will have to look for the existence of a file before firing the
handler. If you are running through a rewriter, you are probably
sending every request to a single file (index.cfm) or perhaps a couple
files, so the existence of that file will probably be cached. But if
you are throwing a bunch of urls at cf that all look like different
file names "/my-article-1.cfm, /my-article-2.cfm, etc) then it will
have to look for the existence of every unique url before firing the
handler.

Have you done any overhead comparison between the two methods?

Judah

On Fri, Oct 17, 2008 at 12:51 PM, Michael Dinowitz
<[EMAIL PROTECTED]> wrote:
> I did the same with the global error handler and that was the wrong tool.
> The onmissingtemplate() handler is a very good tool for this, especially for
> those who do not have the ability to use a rewriter. As for the intent of
> the onmissingtemplate() handler, it was discussed while in beta and things
> were changed to make sure that it could be used properly for handling
> intended missing templates.
>
> I use this for my clients and for my own sites, even when I have access to
> the webserver. It can actually be more efficient than a rewriter, not less.
> A rewriter looks at EVERY request. images, css, js, whatever. The
> onmissingtemplate() deals with a CF template only and only the one
> requested. I'd rather be more specific on whats being handled that less so,
> especially when the less so is global to the entire site.
>
> On Fri, Oct 17, 2008 at 3:44 PM, Judah McAuley <[EMAIL PROTECTED]> wrote:
>
>> I did this back in the days of CF 5 where I'd use the site-wide error
>> template as a url remapper. It worked. I won't really recommend it
>> though because it is using a tool that was really meant for a
>> different task.
>>
>> Instead, I'd suggest using a url rewriter plugin for your webserver.
>> modrewrite for apache or isapi rewrite for IIS, there are probably
>> others, will let you handle incoming requests at the webserver level
>> and produce requests to CF that have the proper combination of query
>> string objects that you'd expect in a normal request. That would then
>> leave you to use onMissingTemplate() to handle what it was intended
>> for..missing templates.
>>
>> So in short, yes, it should work. But no, I wouldn't do it that way :)
>>
>> Judah
>>
>> On Fri, Oct 17, 2008 at 7:46 AM, Jason Fill <[EMAIL PROTECTED]> wrote:
>> > I am currently trying to plan out an application and am curious about
>> what other think about something I have in mind.
>> >
>> > I would like the URLs to be in the form of
>> domain.com/thepagename-pageid.cfm.  Simple as that....but the page will
>> not actually exist.  My thought was just to use the onMissingTemplate()
>> handler to handle the request and dynamically generate the content.
>> >
>> > The issue is, I am not sure if this is completely the incorrect line of
>> thinking - AND - also what the performance implications might be under load.
>> >
>> > I know an ISAPI rewrite can be used, but I want to stay away from that as
>> this application will be distributed to others and I do not want them to
>> have to reconfigure their webserver.  It need to work right out of the box.
>> >
>> > Any suggestions would be helpful.  I have read some blog posts in regards
>> to this and I know some people are using it, but mostly curious if anyone
>> sees a major issue with this under a load situation.
>> >
>> > Thanks in advance!
>> >
>> >
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314061
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to