Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup #20

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

cleanup #20

wants to merge 25 commits into from

Conversation

marfoldi
Copy link
Contributor

@marfoldi marfoldi commented Sep 25, 2023

  • Some cleanup in "src/utils/normalize-request.ts"
  • Add dependabot
  • Add linter
  • Publish to GitHub packages

@marfoldi marfoldi requested a review from a team as a code owner September 25, 2023 11:25
cf: {
// NOTE: cf is Enterprise only feature
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@samkahchiin I did not find in the documentation that this would be an enterprise-only feature, maybe it is publicly available now?

response = new Response(response.body, response);
response.headers.set('edge-cache-ttl', `${edgeCacheTtl}`)
if (edgeCacheTtl > 0) { // Only set the header if edgeCacheTtl is set
response.headers.set('edge-cache-ttl', `${edgeCacheTtl}`);
Copy link
Contributor Author

@marfoldi marfoldi Sep 25, 2023

Choose a reason for hiding this comment

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

Do we want to set this to 0 if not defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

The whole point of such a repo is to have sane defaults for all projects, i.e. ideally, we can always use this project without any options set at all, because we have great defaults for everything.

What would be a great default for caching?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I'm just wondering whether it wouldn't be unexpected that everything is getting cached let's say for a day. It would definitely be needed to add CircleCi --> Purge Cloudflare cache on deploy for every project as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed. Purging the cache after deploy should be in the standardized CircleCi config file :)

Comment on lines +27 to +28
accountId?: string
zoneId?: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are unused, leaving them here as optional properties, one might find it helpful to identify deployments in their worker code....

Copy link
Contributor

@swiknaba swiknaba left a comment

Choose a reason for hiding this comment

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

Thanks! Left a few suggestions & questions -- @marfoldi PTAL

src/utils/deployment-for-request.ts Show resolved Hide resolved
response = new Response(response.body, response);
response.headers.set('edge-cache-ttl', `${edgeCacheTtl}`)
if (edgeCacheTtl > 0) { // Only set the header if edgeCacheTtl is set
response.headers.set('edge-cache-ttl', `${edgeCacheTtl}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole point of such a repo is to have sane defaults for all projects, i.e. ideally, we can always use this project without any options set at all, because we have great defaults for everything.

What would be a great default for caching?

src/utils/normalize-request.ts Outdated Show resolved Hide resolved
.npmrc Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
swiknaba
swiknaba previously approved these changes Sep 27, 2023
Copy link
Contributor

@swiknaba swiknaba left a comment

Choose a reason for hiding this comment

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

Great thanks!

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.

2 participants