|
|
|
date: Fri, 5 Oct 2007 14:43:03 -0700,
group: microsoft.public.platformsdk.internet.server.isapi-dev
back
Re: ISAPI Extension
On Oct 5, 2:43 pm, thejackofall
wrote:
> Hi.
>
> I need to create an ISAPI extension DLL that will replace a list of keywords
> in pages with a link dynamically (using the keywords) as the IIS processes
> the pages.
>
> I did some search, but I am not sure where to even start. ISAPI extension
> doesn't seem to be well-documented.
>
> Can anyone help?
> --
> Be Cool!
ISAPI Extension is documented well enough on MSDN, and sample code
within the Windows Platform SDK can be found.
In the tradition typical of the Internet, there are lots of crufty
ISAPI source code out there, mostly free, so you get what you paid.
Now, the technical answer to your question is "it is not possible",
but that is only because you asked the wrong question.
The sort of behavior you described is possible with the
SF_NOTIFY_SEND_RAW_DATA event of ISAPI Filters. You can buffer the raw
data of the page *after* it has been processed and modify it as you
want.
However, I recommend against implementing that solution because you
also described you wanted:
> replace a list of keywords in pages with a link dynamically
> (using the keywords) as the IIS processes the pages.
Without getting into the details at the moment, you are making invalid
assumptions of how IIS processes a request (notice I do not say that
IIS processes the pages, because it doesn't process any data from any
page it serves). What you describe is what the Application Handler
does when IIS loads it to process a page (see link off my MSDN blog on
how request processing works, logically). Thus, depending on the
abilities of the Application Handler of the page that you are talking
about, you may be able to accomplish your task without even using
ISAPI.
I don't really know what you are trying to accomplish nor your
situation/circumstance, so I cannot give more optimal/concrete
answers.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
date: Sun, 07 Oct 2007 03:50:13 -0700
author: David Wang
Re: ISAPI Extension
Basically, our companys has many websites run under Microsoft IIS. I don't
have a control over their applications or pages.
I need to create an extension or a filter which would replace the keywords
such as "football" with a link that would point to a sister website or an URL
with the same keyword.
--
Be Cool!
"David Wang" wrote:
> On Oct 5, 2:43 pm, thejackofall
> wrote:
> > Hi.
> >
> > I need to create an ISAPI extension DLL that will replace a list of keywords
> > in pages with a link dynamically (using the keywords) as the IIS processes
> > the pages.
> >
> > I did some search, but I am not sure where to even start. ISAPI extension
> > doesn't seem to be well-documented.
> >
> > Can anyone help?
> > --
> > Be Cool!
>
>
>
> ISAPI Extension is documented well enough on MSDN, and sample code
> within the Windows Platform SDK can be found.
>
> In the tradition typical of the Internet, there are lots of crufty
> ISAPI source code out there, mostly free, so you get what you paid.
>
> Now, the technical answer to your question is "it is not possible",
> but that is only because you asked the wrong question.
>
> The sort of behavior you described is possible with the
> SF_NOTIFY_SEND_RAW_DATA event of ISAPI Filters. You can buffer the raw
> data of the page *after* it has been processed and modify it as you
> want.
>
> However, I recommend against implementing that solution because you
> also described you wanted:
> > replace a list of keywords in pages with a link dynamically
> > (using the keywords) as the IIS processes the pages.
>
> Without getting into the details at the moment, you are making invalid
> assumptions of how IIS processes a request (notice I do not say that
> IIS processes the pages, because it doesn't process any data from any
> page it serves). What you describe is what the Application Handler
> does when IIS loads it to process a page (see link off my MSDN blog on
> how request processing works, logically). Thus, depending on the
> abilities of the Application Handler of the page that you are talking
> about, you may be able to accomplish your task without even using
> ISAPI.
>
> I don't really know what you are trying to accomplish nor your
> situation/circumstance, so I cannot give more optimal/concrete
> answers.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
date: Mon, 8 Oct 2007 12:55:04 -0700
author: thejackofall
Re: ISAPI Extension
With that sort of requirement, you will have to write an ISAPI Filter
to buffer outbound data, parse the HTML to do your substitution, parse
and revise various HTTP headers to make sure the changes are accounted
for, and then send the modified response back to the client.
This will make the IO for all requests synchronous as well as turn off
IIS response caches (for example, the HTTP.SYS Kernel Response cache
on IIS6), so you can expect a big impact on performance, scalability,
and reliability. Depending on your traffic load, you may need to
purchase additional servers and/or revise the architecture of the web
applications whose responses are modified.
I am not trying to scare you, but I'm not sugar-coating anything,
either. I am just stating what happens when you want to do things in
the way that you want. Maybe you are hosting free sites and this is
the pain they have to live with. Or if you are hosting sites that are
cooperative, maybe there's a better way to inject advertising inline
with server-side processing and not as an after-thought by munging
HTTP within IIS. You can always do the munging, but no one says it's
efficient nor desireable.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On Oct 8, 12:55 pm, thejackofall
wrote:
> Basically, our companys has many websites run under Microsoft IIS. I don't
> have a control over their applications or pages.
>
> I need to create an extension or a filter which would replace the keywords
> such as "football" with a link that would point to a sister website or an URL
> with the same keyword.
>
> --
> Be Cool!
>
>
>
> "David Wang" wrote:
> > On Oct 5, 2:43 pm, thejackofall
> > wrote:
> > > Hi.
>
> > > I need to create an ISAPI extension DLL that will replace a list of keywords
> > > in pages with a link dynamically (using the keywords) as the IIS processes
> > > the pages.
>
> > > I did some search, but I am not sure where to even start. ISAPI extension
> > > doesn't seem to be well-documented.
>
> > > Can anyone help?
> > > --
> > > Be Cool!
>
> > ISAPI Extension is documented well enough on MSDN, and sample code
> > within the Windows Platform SDK can be found.
>
> > In the tradition typical of the Internet, there are lots of crufty
> > ISAPI source code out there, mostly free, so you get what you paid.
>
> > Now, the technical answer to your question is "it is not possible",
> > but that is only because you asked the wrong question.
>
> > The sort of behavior you described is possible with the
> > SF_NOTIFY_SEND_RAW_DATA event of ISAPI Filters. You can buffer the raw
> > data of the page *after* it has been processed and modify it as you
> > want.
>
> > However, I recommend against implementing that solution because you
> > also described you wanted:
> > > replace a list of keywords in pages with a link dynamically
> > > (using the keywords) as the IIS processes the pages.
>
> > Without getting into the details at the moment, you are making invalid
> > assumptions of how IIS processes a request (notice I do not say that
> > IIS processes the pages, because it doesn't process any data from any
> > page it serves). What you describe is what the Application Handler
> > does when IIS loads it to process a page (see link off my MSDN blog on
> > how request processing works, logically). Thus, depending on the
> > abilities of the Application Handler of the page that you are talking
> > about, you may be able to accomplish your task without even using
> > ISAPI.
>
> > I don't really know what you are trying to accomplish nor your
> > situation/circumstance, so I cannot give more optimal/concrete
> > answers.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //- Hide quoted text -
>
> - Show quoted text -
date: Mon, 08 Oct 2007 20:42:31 -0700
author: David Wang
|
|