httpmodules httphandlers, whats the ideal use of them? when to use and when not to use?

前端 未结 6 855
清酒与你
清酒与你 2021-02-04 13:36

I have some questions about httpmodules and httphandlers, i am a little confused of the real need of them, i created many websites, but rarely used them, sure i lost a benefit f

6条回答
  •  野性不改
    2021-02-04 14:27

    HttpModules and HttpHandlers are useful when you wish to change IIS's default handling of documents either by changing the behavior entirely or adding pre or post processing to the document.

    One practical application I've had for an HttpModule is for dynamic thumbnail creation. I wrote an HttpModule that handled all image requests. If the request contained the query string "?thumb", I'd dynamically generate a thumbnail rather than serving up the original image.

    I've also seen HttpModules used to remove comments and whitespace from aspx page output and url rewriting.

提交回复
热议问题