PHPackages                             peterujah/ob-compress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. peterujah/ob-compress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

peterujah/ob-compress
=====================

Php class to compress output buffer in gzip.

1.7(2y ago)3100MITPHPPHP ^7.0 || ^8.0

Since Feb 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/peterujah/ob-compress)[ Packagist](https://packagist.org/packages/peterujah/ob-compress)[ RSS](/packages/peterujah-ob-compress/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)DependenciesVersions (6)Used By (0)

ob-compress
===========

[](#ob-compress)

Php OBCompress, compresses the Output Buffer In Gzip

This class can compress the output buffer of a web page or web request.

It can start capturing the output buffer of the current HTTP request and compress using the gzip compression method or none based on specified options. The compressed output will be send with the necessary headers back to user browser and optimized. It can process the responses of requests and output data in JSON, HTML, or plain text format faster than regular request output.

Installation
------------

[](#installation)

Installation is super-easy via Composer:

```
composer require peterujah/ob-compress
```

To compress webpage output, see the below example code

```

Text OB Compress

    This will be compress and optimized
