49 lines
2.1 KiB
HTML
49 lines
2.1 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html lang="zh-CN">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="UTF-8">
|
|||
|
|
<title>静态页面测试 - 实验4</title>
|
|||
|
|
<style>
|
|||
|
|
body { font-family: Arial, sans-serif; margin: 40px; background: #f0f4f8; color: #333; }
|
|||
|
|
h1 { color: #2a7; }
|
|||
|
|
.box { background: white; padding: 20px; border-radius: 10px; margin: 15px 0;
|
|||
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
|
|||
|
|
table { width: 100%; border-collapse: collapse; margin: 15px 0; }
|
|||
|
|
th, td { border: 1px solid #ddd; padding: 10px; text-align: left; }
|
|||
|
|
th { background: #667eea; color: white; }
|
|||
|
|
a { color: #667eea; }
|
|||
|
|
</style>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<h1>📄 静态页面测试</h1>
|
|||
|
|
<p>本页面用于验证Web服务器的静态资源服务能力(包括缓存功能)。</p>
|
|||
|
|
|
|||
|
|
<div class="box">
|
|||
|
|
<h2>服务器特性对比</h2>
|
|||
|
|
<table>
|
|||
|
|
<tr><th>版本</th><th>I/O模型</th><th>并发模型</th><th>缓存</th><th>方法</th></tr>
|
|||
|
|
<tr><td>实验1</td><td>阻塞I/O</td><td>单进程</td><td>❌</td><td>GET</td></tr>
|
|||
|
|
<tr><td>实验2</td><td>阻塞I/O</td><td>多线程/预线程</td><td>❌</td><td>GET</td></tr>
|
|||
|
|
<tr><td>实验3</td><td>阻塞I/O</td><td>线程池/流水线</td><td>❌</td><td>GET</td></tr>
|
|||
|
|
<tr><td style="color:#2a7;font-weight:bold;">实验4</td>
|
|||
|
|
<td style="color:#2a7;">epoll</td>
|
|||
|
|
<td style="color:#2a7;">线程池</td>
|
|||
|
|
<td style="color:#2a7;">✅ LRU</td>
|
|||
|
|
<td style="color:#2a7;">GET+POST</td></tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="box">
|
|||
|
|
<h2>实验4 新增功能</h2>
|
|||
|
|
<ul>
|
|||
|
|
<li><strong>epoll I/O多路复用:</strong> 主线程使用epoll监控所有连接,边缘触发模式</li>
|
|||
|
|
<li><strong>LRU缓存:</strong> 哈希表 + 双向链表,O(1)查找和淘汰</li>
|
|||
|
|
<li><strong>POST方法:</strong> 支持表单提交和CGI转发</li>
|
|||
|
|
<li><strong>缓存命中指示:</strong> 响应头 X-Cache: HIT/MISS</li>
|
|||
|
|
</ul>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<p><a href="/">← 返回首页</a></p>
|
|||
|
|
</body>
|
|||
|
|
</html>
|