Skip to content

Conversation

@loks0n
Copy link
Contributor

@loks0n loks0n commented Oct 16, 2024

Adds setCompression configuration method to utopia Http

If enabled, this performs brotli, gzip, or delate (in decreasing priority) compression on response bodies of requests that:

  • have a whitelisted mime-type (text/* etc)
  • AND are greater than 1KB
  • AND have accept-encoding header

@loks0n loks0n requested a review from eldadfux October 16, 2024 11:13
@loks0n loks0n changed the title feat: utopia compression WIP: feat: utopia compression Oct 16, 2024
@loks0n loks0n changed the title WIP: feat: utopia compression feat: utopia compression Oct 16, 2024
@loks0n loks0n marked this pull request as draft October 16, 2024 11:14
@loks0n loks0n marked this pull request as ready for review October 17, 2024 12:45
@loks0n loks0n requested a review from eldadfux October 23, 2024 09:55
composer.json Outdated
Comment on lines 36 to 40
"repositories": {
"utopia-php/compression": {
"type": "git",
"url": "https://github.com/utopia-php/compression"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed now that the package was published.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the filename/location is not consistent with what we do in other utopia libs. Maybe we can use the database library or something else for a pattern we can reuse here.

Copy link
Contributor Author

@loks0n loks0n Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you like this?

tests/
    e2e/
        Server/
            SwooleTest.php
            FPMTest.php
            SwooleCompressionTest.php
            ...
            resources/
                init.php
                SwooleServer.php
                FPMServer.php
                SwooleCompressionServer.php
                ... 

@loks0n loks0n requested a review from eldadfux May 7, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants