Problem/Motivation

JSON:API responses are currently sent with the application/vnd.api+json mimetype. This is not one of the supported File types that CloudFront compresses. Furthermore, it seems that this is not a common mimetype enabled in nginx or apache config. For example this is the list of mimetypes in the DDEV nginx config.

By changing the mimetype to application/json we would get gzip compression out of the box for a lot of people. I'm certain there is a reason why we need to use application/vnd.api+json, so perhaps this is a simple "won't fix". Would be good to get some discussion here.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mstrelan created an issue. See original summary.

mstrelan’s picture

FWIW it seems CloudFlare supports the current mimetype https://developers.cloudflare.com/speed/optimization/content/brotli/cont...

bbrala’s picture

Status: Active » Postponed (maintainer needs more info)

Unfortunately: JSON:API requires use of the JSON:API media type (application/vnd.api+json) for exchanging data.

So it would be off-spec to use something else. You could discuss alternative options, like go offspec yourself by changing the header with some custom code. But we cannot change how core does this.

mstrelan’s picture

I considered changing the header, and it seems to work, but concerned it may lead to issues. We can also configure nginx to compress application/vnd.api+json, but ideally I'd like CloudFront to do it for us.

Happy for this to be closed, but leaving it open for now in case anyone has any novel ideas.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since there's been no follow up in 11+ months going to close out.

If still a desired feature please re-open!