1- # Laravel Response Optimizer
1+ # Laravel Response Compression
22
3- Boost your Laravel application's performance by optimizing HTTP responses with middleware for compression and HTML minification.
4-
5- ## Key Features
6-
7- #### Compression
8-
9- Shrink response payloads using Gzip or Brotli compression.
10-
11- #### HTML Minification
12-
13- Reduce the size of HTML responses by eliminating unnecessary whitespace and formatting.
3+ Boost your Laravel application's performance by optimizing HTTP responses with middleware for compression.
144
155---
166
@@ -19,13 +9,13 @@ Reduce the size of HTML responses by eliminating unnecessary whitespace and form
199Install the package via Composer:
2010
2111``` bash
22- composer require chr15k/laravel-response-optimizer
12+ composer require chr15k/laravel-response-compression
2313```
2414
2515Publish the configuration file:
2616
2717``` bash
28- php artisan vendor:publish --provider=" Chr15k\ResponseOptimizer\ResponseOptimizerServiceProvider "
18+ php artisan vendor:publish --provider=" Chr15k\ResponseCompression\ResponseCompressionServiceProvider "
2919```
3020
3121---
@@ -40,10 +30,6 @@ Applies Gzip or Brotli compression to HTTP responses based on client support. Th
4030
4131** Ideal For** : Large JSON responses, static files, or data-intensive endpoints.
4232
43- #### 2. HTML Minification Middleware
44-
45- Minifies HTML responses by removing unnecessary whitespace and formatting to reduce payload size.
46-
4733---
4834
4935## Setup
@@ -61,8 +47,7 @@ Apply the middleware globally to all requests:
6147 ...
6248 $middleware->web(append: [
6349 ...
64- \Chr15k\ResponseOptimizer\Middleware\MinifyHtml::class,
65- \Chr15k\ResponseOptimizer\Middleware\CompressResponse::class,
50+ \Chr15k\ResponseCompression\Middleware\CompressResponse::class,
6651 ]);
6752})
6853```
@@ -72,7 +57,7 @@ Apply the middleware globally to all requests:
7257Alternatively, register it as route middleware for selective application:
7358
7459``` php
75- use Chr15k\ResponseOptimizer \Middleware\CompressResponse;
60+ use Chr15k\ResponseCompression \Middleware\CompressResponse;
7661
7762Route::get('/profile', function () {
7863 // ...
@@ -97,4 +82,4 @@ Contributions are welcome! Submit a pull request or open an issue to discuss new
9782
9883## License
9984
100- The MIT License (MIT). Please see [ License File] ( https://github.com/chr15k/laravel-response-optimizer /blob/main/LICENSE ) for more information.
85+ The MIT License (MIT). Please see [ License File] ( https://github.com/chr15k/laravel-response-compression /blob/main/LICENSE ) for more information.
0 commit comments