首先,关于 Nathanael Jones 博客的引用链接,虽然磁盘 IO 比内存操作慢得多,但大多数网站都不受磁盘 IO 限制,坦率地说,他的大多数解决方案都是没有受过教育的废话。
一般来说,只有极少数情况下您会成为 DISK io 绑定。首先是数据库服务器本身。如果它没有足够的 RAM 来将数据库的相关部分保存在内存中,那么该服务器的磁盘速度至关重要;特别是在高交易情况下。
其次,如果您的应用程序直接读写大量文件,您可能会受到磁盘 IO 的限制。很少有应用程序这样做。我没有计算应用程序的 .aspx 或 .html 文件,因为它们可以被现有框架和 IIS 缓存。
基本上,直接无视他。
The whole filesystem to database syncing idea as a method to improve performance is of no value to about 99.999% of sites. If nothing else the database should be pushing files to the web server file system, not the other way around. I have seen exactly 1 site in 20 years of development that required this. They serve several million page views a day. Also, he is flat wrong about making a database call across a network being faster than loading an equivalent amount of data from a local file.
Next, the actual area that we are really bound at is in sending data across the network to the client browser. This is ALWAYS slower than reading a file from a disk; even with no traffic on the line. Hard drives move data much faster than your network card can. Taking it one step further; modern hard drives are orders of magnitude faster than your internet connection. The best thing you can do to improve performance is just to limit the number of connection requests a single page load requires. Optimization here means having 1 css file, not 20; having just a couple .js file references, not 100; and combining graphics into sprites where feasible. It's faster to transfer 1 big file than 100 small files due to how TCP works.
Maybe on an overloaded shared server you might have an issue. However, the reality is that an overloaded shared server is going to be network congested long before it's disk queue length grows out of control.
With that out of the way, let's look at your actual issue.
The javascript items have two preferred locations: 1. As .js files on the web server or 2. embedded in your master page. Just do option 1, they will be cached by the web server. Further, they will be cached by the client browser meaning you won't have to
For your header and footer, the code for this should be in your master page. Don't do server side includes, that just complicates things. Build a normal .net website that leverages master pages for your "chrome" content. You can enable partial page caching at the application level which will handle all of caching for you.
When you update the header or footer content, just redeploy the site.