Depending on the needs of your application (e.g., if your application uses .htm and .asp files), you might want to take particular actions. For example, if your application redirects users to a logon page from the Session_OnStart event in global.asa, users might be able to bypass this logon scheme. These users get around the logon page by entering a URL for a .htm page in the address line of the Web browser or by choosing a URL from the Favorites list that points to a .htm page. When IIS sees the .htm file, it will not execute the global.asa file because .htm files don't map to asp.dll.

You might encounter problems in an application that uses a session state when users access .htm pages and the application doesn't touch a .asp page during the session's timeout period. This situation causes the session to time out because the session timer doesn't update when the users access .htm pages.

You can solve both the logon bypass and the session timeout problem by mapping .htm files to asp.dll. When you map these files to asp.dll, IIS treats .htm files exactly the same as .asp files processed with asp.dll. When a user accesses a .htm file, IIS processes global.asa and updates the session state timer. The downside of mapping .htm files to asp.dll is that IIS processes these .htm files slightly slower than other .htm files. This slowdown is the result of asp.dll not processing each file directly, which adds to the overall processing time.

Whether you map .htm files to asp.dll depends on your Web site. You can evaluate the effect this action will have by testing your site and recording the results. You can monitor the mapping performance with Performance Monitor, and you can use the Web Capacity Analysis Tool (WCAT), which comes with the Microsoft Internet Information Server Resource Kit, to test various application configurations, including running the site with a mixture of .asp and .htm files and various combinations of users.

To map .htm files to asp.dll, you select the .asp entry you see in Screen 5, and click Edit. Highlight the text in the Executable box in the Add/Edit Application Extension Mapping dialog box, and press Ctrl+C to copy the entry to the clipboard. Next, note the other settings for the entry, and close this dialog box. Click Add, and press Ctrl+V to add the text string you copied from the .asp mapping into the Executable box in the Add/Edit Application Extension Mapping dialog box. Next, enter

.htm

in the Extension box. Your entry will look similar to what you see in Screen 6. Click OK to close the dialog box and make the change permanent. If you map .htm files to asp.dll, you must select the Script engine check box so IIS can process these files with asp.dll when they are in a directory with script access.

Another application setting you might want to change is the cache setting for script files. This setting is on the Process Options tab of the Application Configuration dialog box. You can set this application to one of the following three options: Do not cache ASP files, Cache all requested ASP files, or Max ASP files cached. These settings affect the performance of the application and how users use it. When asp.dll processes an ASP, it compiles, executes, and stores the page in the server's memory cache. IIS searches the cache first when a user requests an ASP. If IIS finds the page in the cache, the software executes the page without accessing the disk and recompiling the file, which results in large performance savings.

IIS defaults to using the second option, Cache all requested ASP files. This selection caches every ASP until the server runs out of available cache memory. You can control this setting by selecting the third option, Max ASP files cached, and entering the number of files you want to cache.

The Do not cache ASP files option is useful for application development. Often, when you are developing an application, you must take steps to ensure your server removes pages from the cache before you retest them. For example, when you edit an ASP, IIS automatically removes it from the cache and recompiles it. However, if you edit an include file (a script or HTML file that is included in another file at runtime), IIS doesn't remove the pages that use the include file from the cache when you make changes to those pages. Therefore, changing and retesting your Web pages can be difficult if you rely on include files. To work around this situation, you can set the Do not cache ASP files option and test files without worrying about which files are cached and which ones aren't. Then when the application is ready for limited testing, you can set the cache option to one of the other two settings.

Debugging IIS
IIS 4.0 provides many tools and features that simplify running ASP applications. One tool, the Script Debugger, enhances IIS 4.0's features by letting you gracefully debug your Web applications. Microsoft's Visual InterDev 6.0, which will soon be widely available in beta, also includes several debugging features that you can use remotely to test your Web applications. Visual InterDev 6.0 will be a valuable upgrade because it includes complete round-trip (i.e., client and server code) debugging.

Next month, I'll show you how and why to use the debugging tools that come with IIS 4.0 and Visual InterDev 6.0. You will learn how these tools can help developers reduce the time they need to create Web applications and reduce the cost of maintaining these applications.

End of Article

Prev. page     1 2 [3]     next page -->



You must log on before posting a comment.

If you don't have a username & password, please register now.

Reader Comments

how i can setup iis setup as proxy server in win nt ? pls send us details.

Epil

I m a fresher who has the interest in the area of networking.So please help me regadring that how can i setup iis setup as proxy server in win nt? Please send us details.

Shantanu S Patel

Good article, but left out something that I feel everyone seems to miss. How do you connect a client like Outlook 2003 to connect to your own drop folder to receive mail?

Steve Nihan

In order to debug my application, what all the settings i need to take care about?

RAJESH

 
 

ADS BY GOOGLE