Web.config file maximum size and count (2024)

Web.config file consists of crucial information for your website to work such as server and application specific settings. Depending on your website and environment, this file can grow quickly. IIS refuses to read it if it exceeds a threshold. This check is in place to prevent possible vulnerability attacks.

Maximum size for web.config file

The default maximum limit is250 KB. You can change this value by editing the registry key below (Reference). Make sure to restart the server after this change.

HKLM\SOFTWARE\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB

It’s a(REG_DWORD)type. More information about this key ishere.

Web.config file maximum size and count (1)

If32-bitis enabled for your application pool, make sure to edit the following key instead:

HKLM\SOFTWARE\Wow6432Node\Microsoft\InetStp\Configuration\MaxWebConfigFileSizeInKB

Is there a better way to manage big web.config file?

Yes. Instead of growing the file size, it’s better to separate the configuration into multiple files. Let’s look at two scenarios.

Extensive amount of URL Rewrite rules

If you have hundreds of URL Rewrite rules, you can createrewrite mapsand store them in a separate file.

Let’s say you have a rewrite map like the one below. Save it in a file calledrewritemaps.config.

<rewriteMaps> <rewriteMap name="Redirects"> <add key="/fromthisURL" value="/tothisURL" /> <add key="/fromthisURL2" value="/tothisURL2" /> </rewriteMap></rewriteMaps>

Then refer it from your web.config file:

<configuration><system.webServer> <rewrite> <rewriteMaps configSource="rewritemaps.config"><rewriteMaps> <rule name="Redirect rule"> ... </rule> </rewrite></system.webServer></configuration>

You can store rewrite rules themselves in a separate file as well:

<rules configSource="rewriteRules.config" />

Just like web.config file, rewritemaps.config and rewriteRules.config files have 250 KB size limit as well.

Is it a good idea to have hundreds of URL rewrite rules or maps in config files? For performance, redirection by using URL Rewrite rules is better as the requests will be redirected before they are handled by ASP.NET handler. For maintenance, it’s better to do redirection and manage URLs in database so config files won’t need to be edited often.

Extensive amount of application settings

If you need to add enormous amount of settings into your config file, you can use multiple web.config files.

In the example below, application settings and connecting strings are stored in separate config files. Here is how they are referenced from the main web.config:

<appSettings configSource="appSpecific.config"></appSettings><connectionStrings configSource="databaseSpecific.config"></connectionStrings>

Maximum count for web.config files

Based on my research, there is no theoretical limit. However, CPU and memory usage can play a factor when there are too many config files mapped.

Web.config file maximum size and count (2024)
Top Articles
Robinhood fined $70 million in record settlement over outages and misleading customers
Discounted Cash Flow DCF Formula
English Bulldog Puppies For Sale Under 1000 In Florida
Forozdz
Skycurve Replacement Mat
Noaa Charleston Wv
Chicago Neighborhoods: Lincoln Square & Ravenswood - Chicago Moms
Mountain Dew Bennington Pontoon
America Cuevas Desnuda
Costco The Dalles Or
Dr Lisa Jones Dvm Married
Co Parts Mn
World of White Sturgeon Caviar: Origins, Taste & Culinary Uses
Craigslist Chautauqua Ny
Dumb Money
7440 Dean Martin Dr Suite 204 Directions
Comics Valley In Hindi
Marvon McCray Update: Did He Pass Away Or Is He Still Alive?
Jayah And Kimora Phone Number
Petco Vet Clinic Appointment
Publix Super Market At Rainbow Square Shopping Center Dunnellon Photos
Silive Obituary
20 Different Cat Sounds and What They Mean
Wbiw Weather Watchers
Gina Wilson All Things Algebra Unit 2 Homework 8
Evil Dead Rise Showtimes Near Regal Sawgrass & Imax
If you have a Keurig, then try these hot cocoa options
About My Father Showtimes Near Copper Creek 9
Regal Amc Near Me
Section 408 Allegiant Stadium
Ringcentral Background
Experity Installer
Inmate Search Disclaimer – Sheriff
Wega Kit Filtros Fiat Cronos Argo 1.8 E-torq + Aceite 5w30 5l
RUB MASSAGE AUSTIN
#1 | Rottweiler Puppies For Sale In New York | Uptown
Emerge Ortho Kronos
The TBM 930 Is Another Daher Masterpiece
Craigslist Ludington Michigan
Why I’m Joining Flipboard
2007 Jaguar XK Low Miles for sale - Palm Desert, CA - craigslist
Atom Tickets – Buy Movie Tickets, Invite Friends, Skip Lines
Kutty Movie Net
Hkx File Compatibility Check Skyrim/Sse
Darkglass Electronics The Exponent 500 Test
Walmart Careers Stocker
This Doctor Was Vilified After Contracting Ebola. Now He Sees History Repeating Itself With Coronavirus
Access to Delta Websites for Retirees
Workday Latech Edu
Blog Pch
Ubg98.Github.io Unblocked
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 5640

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.