You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an updated version of the PR description that incorporates the Cloudflare context and your use case:
PR: Patch for @axiomhq/[email protected] to Resolve Cache Issue with Cloudflare Integration
Hi there! 👋
First, thank you for your work on this library and for making logging ingestion so seamless! 😊
While using @axiomhq/[email protected] in my project, I encountered an issue related to the cache setting when integrating Axiom with a Cloudflare environment. Specifically, Cloudflare does not support cache: 'no-cache', which caused unexpected behavior.
Additionally, while Axiom provides a dedicated Cloudflare Worker module, it isn't suitable for all Cloudflare Worker frameworks. In my case, I’m integrating Axiom ingestion with SvelteKit’s hooks for a server-side logging setup, and the Worker module doesn’t align well with this framework’s architecture.
Problem Description
Environment: I’m using SvelteKit deployed on Cloudflare Pages, which relies on Cloudflare Workers for server-side functionality.
Issue: The current cache: 'no-cache' setting in the FetchClient conflicts with Cloudflare’s implementation, which doesn’t fully respect the no-cache directive. This results in inconsistent behavior where caching occurs unintentionally.
Impact: Requests that should bypass intermediate caches sometimes fail to do so, leading to potential data discrepancies or stale responses.
Solution
To resolve this, I’ve patched the library to replace cache: 'no-cache' with cache: 'no-store'. This ensures that no intermediate caching occurs, as no-store is fully supported by Cloudflare and more reliably enforces uncached requests.
Files Updated
The patch modifies the following files to update the cache setting:
If this change aligns with the goals of the library, I kindly request:
Review and consider integrating this patch: It resolves a common compatibility issue for Cloudflare-based users.
Explore additional support for Cloudflare frameworks: A solution bridging the gap between the general @axiomhq/js package and the specialized Worker module could benefit users working with frameworks like SvelteKit or other server-side tools.
Thank you for your time and consideration! I’m happy to provide additional context or assist further if needed. 😊
hi @dorianjp, thanks for your contribution! I have created a PR with the change, glad to help. Once its approved by the team, a new release will be pushed.
Here's an updated version of the PR description that incorporates the Cloudflare context and your use case:
PR: Patch for
@axiomhq/[email protected]
to Resolve Cache Issue with Cloudflare IntegrationHi there! 👋
First, thank you for your work on this library and for making logging ingestion so seamless! 😊
While using
@axiomhq/[email protected]
in my project, I encountered an issue related to thecache
setting when integrating Axiom with a Cloudflare environment. Specifically, Cloudflare does not supportcache: 'no-cache'
, which caused unexpected behavior.Additionally, while Axiom provides a dedicated Cloudflare Worker module, it isn't suitable for all Cloudflare Worker frameworks. In my case, I’m integrating Axiom ingestion with SvelteKit’s
hooks
for a server-side logging setup, and the Worker module doesn’t align well with this framework’s architecture.Problem Description
cache: 'no-cache'
setting in theFetchClient
conflicts with Cloudflare’s implementation, which doesn’t fully respect theno-cache
directive. This results in inconsistent behavior where caching occurs unintentionally.Solution
To resolve this, I’ve patched the library to replace
cache: 'no-cache'
withcache: 'no-store'
. This ensures that no intermediate caching occurs, asno-store
is fully supported by Cloudflare and more reliably enforces uncached requests.Files Updated
The patch modifies the following files to update the
cache
setting:dist/cjs/fetchClient.cjs
dist/esm/fetchClient.js
src/fetchClient.ts
Here’s the relevant diff:
Request
If this change aligns with the goals of the library, I kindly request:
@axiomhq/js
package and the specialized Worker module could benefit users working with frameworks like SvelteKit or other server-side tools.Thank you for your time and consideration! I’m happy to provide additional context or assist further if needed. 😊
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: