Skip to content

Conversation

@Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Nov 24, 2025

🧭 What and Why

By reordering the conditions, we now allow a POST request to explicitly be cached, even if it doesn't per se use the read requester.

Usage in customPost for example:

customPost({
  path: '/xxx',
}, {
  cacheable: true
})

Changes included:

  • cacheable is accepted in request or requestOptions for a non-read request as well.

🧪 Test

Added tests for the transporter

By reordering the conditions, we now allow a POST request to explicitly be cached, even if it doesn't per se use the read requester.

Usage in customPost for example:

```
customPost({
  path: '/xxx',
}, {
  cacheable: true
})
```
@Haroenv Haroenv requested a review from a team as a code owner November 24, 2025 15:55
@Haroenv Haroenv requested review from Fluf22 and shortcuts November 24, 2025 15:55
@algolia-bot
Copy link
Collaborator

algolia-bot commented Nov 24, 2025

No code generated

If you believe code should've been generated, please, report the issue.

📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 2415

@Haroenv Haroenv changed the title feat(cache): allow cache on POST feat(javascript): allow cache on POST Nov 24, 2025
@Fluf22 Fluf22 enabled auto-merge (squash) December 3, 2025 08:08
@Fluf22 Fluf22 merged commit 4ce8b7d into main Dec 3, 2025
13 checks passed
@Fluf22 Fluf22 deleted the feat/cacheable-custom-post branch December 3, 2025 08:20
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Dec 3, 2025
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.

4 participants