Skip to content

Conversation

@hannahhoward
Copy link
Member

Goals

Use compressed format for indexer queries when serving RAW requests

Implementation

Set the compressed parameter on the locator when a raw request is detected

@hannahhoward hannahhoward merged commit ef32fa9 into main Oct 27, 2025
1 check passed
@hannahhoward hannahhoward deleted the feat/compressed-query-on-raw branch October 27, 2025 09:31
hannahhoward pushed a commit that referenced this pull request Oct 27, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.31.1](v2.31.0...v2.31.1)
(2025-10-27)


### Bug Fixes

* **middleware:** use compressed format for raw requests
([#186](#186))
([ef32fa9](ef32fa9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

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

✅ LGTM

const compressed =
searchParams.get('format') === 'raw' ||
headers.get('Accept')?.includes('application/vnd.ipld.raw')
const locator = Locator.create({ client, compressed })
Copy link
Member

Choose a reason for hiding this comment

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

Presumably a block request is in the context of a DAG retrieval?

Would caching the index and location claim(s) locally help? Or is it a case of too many requests and too much churn? We're forcing a request to the indexer for every block when bitswapping over HTTP now.

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