denismitr/etag 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

denismitr/etag

Composer 安装命令:

composer require denismitr/etag

包简介

Etag Middleware for Laravel

README 文档

README

Build Status

This a middleware specifically for the Laravel framework and RESTful APIs build with it. It hashaes the response content and adds it to ETag header of HTTP response. Then it listenes to If-Match and If-None-Match headers of the requests that expect to receive json in response in order to see if a new content needs to be delivered or just 304 Not Modified response is sufficient.

Author

Denis Mitrofanov

TheCollection.ru

Installation

Use composer to install the package:

composer require denismitr/etag

Include in your app/Http/Kernel.php to the appropriate section (all requests if all your routes are API or named middleware + API middleware group to make it work for every api route or just named middleware):

Global middleware

/**
 * The application's global HTTP middleware stack.
 *
 * These middleware are run during every request to your application.
 *
 * @var array
 */
protected $middleware = [
    ...
    \Denismitr\ETags\ETagMiddleware::class
];

Named middleware

/**
 * The application's route middleware.
 *
 * These middleware may be assigned to groups or used individually.
 *
 * @var array
 */
protected $routeMiddleware = [
    ...
    'etag' => \Denismitr\ETags\ETagMiddleware::class,
];

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' => [
        ...
    ],

    'api' => [
        ...
        'etag'
    ],
];

统计信息

  • 总下载量: 266
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固