<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Middleware on PlumePHP</title><link>https://plumephp.com/tags/middleware/</link><description>Recent content in Middleware on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 02 May 2021 09:15:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/middleware/index.xml" rel="self" type="application/rss+xml"/><item><title>中间件模式：构建灵活的 Web 应用</title><link>https://plumephp.com/51-middleware-patterns/</link><pubDate>Sun, 02 May 2021 09:15:00 +0800</pubDate><guid>https://plumephp.com/51-middleware-patterns/</guid><description>&lt;h1 id="中间件模式构建灵活的-web-应用"&gt;中间件模式：构建灵活的 Web 应用&lt;/h1&gt;
&lt;p&gt;在 Web 开发中，有很多横切关注点（cross-cutting concerns）需要在每个请求中处理：日志记录、身份验证、权限检查、请求限流、CORS 处理等等。如果把这些逻辑都写在每个 handler 里，代码会变得冗余且难以维护。&lt;/p&gt;</description></item></channel></rss>