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

Add documentation for cache control headers on cloud-backed media #4599

Merged
merged 3 commits into from
Jul 31, 2024

Conversation

CamronStaley
Copy link
Contributor

@CamronStaley CamronStaley commented Jul 30, 2024

What changes are proposed in this pull request?

Updating documentation to inform customers about how to enable browser caching for our supported cloud media types.

https://voxel51.atlassian.net/browse/TEAMS-3180

How is this patch tested? If it is not, please explain why.

n/a

Release Notes

Is this a user-facing change that should be mentioned in the release notes?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release
    notes for FiftyOne users.

(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)

What areas of FiftyOne does this PR affect?

  • App: FiftyOne application changes
  • Build: Build and test infrastructure changes
  • Core: Core fiftyone Python library changes
  • Documentation: FiftyOne documentation changes
  • Other

Summary by CodeRabbit

  • Documentation
    • Added a new section on "Browser Caching" to improve guidance on optimizing performance for cloud-backed media.
    • Included specific recommendations for configuring cache-control headers for various cloud platforms, enhancing data handling efficiency for users.

Copy link
Contributor

coderabbitai bot commented Jul 30, 2024

Walkthrough

The recent update enhances the documentation by adding a section on "Browser Caching." This new content highlights the significance of enabling built-in browser caching for cloud-backed media, providing specific guidance for various cloud platforms. Users are equipped with actionable insights to optimize their data handling and improve performance through effective cache-control header configurations.

Changes

Files Change Summary
docs/source/teams/installation.rst Introduced a "Browser Caching" section with recommendations for Amazon S3, Google Cloud Storage, Microsoft Azure, and MinIO, focusing on how to set cache-control headers.

Poem

🐰 In the cloud where data flows,
A rabbit hops where caching grows.
With headers set, the speed is grand,
Performance leaps, oh, isn't it grand?
Bouncing faster, no time to waste,
In browser's embrace, we find our pace! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ff96f24 and 289e2c4.

Files selected for processing (1)
  • docs/source/teams/installation.rst (5 hunks)
Additional comments not posted (5)
docs/source/teams/installation.rst (5)

180-186: Clear and informative introduction to browser caching.

The section provides a good overview of the importance of enabling browser caching for cloud-backed media.


274-276: Accurate and complete instructions for Amazon S3.

The section provides clear instructions for specifying cache-control headers on S3 objects.


342-344: Accurate and complete instructions for Google Cloud Storage.

The section provides clear instructions for specifying cache-control headers on GCP content.


456-458: Accurate and complete instructions for Microsoft Azure.

The section provides clear instructions for specifying cache-control headers on Azure blobs.


530-532: Accurate and complete instructions for MinIO.

The section provides clear instructions for specifying cache-control headers on MinIO content using the metadata field of the put_object API.

Copy link
Contributor

@sashankaryal sashankaryal left a comment

Choose a reason for hiding this comment

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

🚀 🚀 🚀
looking good, requesting changes for adding a line or two that describes each provider's defaults

Comment on lines 274 to 276
If you would like to take advantage of browser caching you can
`specify cache-control headers on S3 objects <https://docs.aws.amazon.com/whitepapers/latest/build-static-websites-aws/controlling-how-long-amazon-s3-content-is-cached-by-amazon-cloudfront.html#specify-cache-control-headers>`_.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we mention that S3 by-default doesn't send anything for cache-controls header and that if customers are unsure, they can leave it as-is and up to the browser heuristics engine? (which uses other metadata like mime-type, etc to determine a reasonable default)

Comment on lines 342 to 344
If you would like to take advantage of browser caching you can
`specify cache-control headers on GCP content <https://cloud.google.com/storage/docs/metadata#cache-control>`_.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should mention the max-age=0 default here and how it is pernicious.

Comment on lines 456 to 458
If you would like to take advantage of browser caching you can
`specify cache-control headers on Azure blobs <https://learn.microsoft.com/en-us/azure/cdn/cdn-manage-expiration-of-blob-content#setting-cache-control-headers-by-using-azure-powershell>`_.

Copy link
Contributor

Choose a reason for hiding this comment

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

IDK what Azure's default is, but if it's not too hard of an info to get, I suggest including it.

Comment on lines 183 to 184
If your datasets include cloud-backed media, we recommend configuring your data
sources to allow for built in browser caching. This will cache signed URL responses
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd go as far as imploring them to do it 😄

Maybe ...we strongly recommend...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 - for the other comments I can include the default but I feel like in general we should just tell them to do it instead of hoping that the browser or storage solution handles it properly. Like Stuart mentioned on the ticket some of these "defaults" change based on how you've setup your storage permissions so it's possible our default is different from theirs just based on how we have configured our data to begin with. I'm afraid to say (as an example) "S3 doesn't provide cache headers by default" but if their bucket has X configuration it starts some default value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Valid. I'm not aware of anything you can configure bucket-level that affects that particular metadata in either S3 or GCP - which is why I insisted on including it - but I defer to you - what you're saying makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was looking around online and seems like GCP is the only one providing a default value (added these in a commit) but probably best to also strongly recommend them to configure it for themselves instead of taking the gamble.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 289e2c4 and 8d1a7cb.

Files selected for processing (1)
  • docs/source/teams/installation.rst (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • docs/source/teams/installation.rst

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d1a7cb and ef55b66.

Files selected for processing (1)
  • docs/source/teams/installation.rst (5 hunks)
Files skipped from review as they are similar to previous changes (1)
  • docs/source/teams/installation.rst

@sashankaryal sashankaryal self-requested a review July 31, 2024 15:37
@sashankaryal
Copy link
Contributor

LGTM! 🎸

@benjaminpkane
Copy link
Contributor

Be sure the docs formatting looks correct before merging. Link here 😄

@CamronStaley
Copy link
Contributor Author

@benjaminpkane downloaded and reviewed locally it looks correct merging now!

@CamronStaley CamronStaley merged commit 0a62688 into develop Jul 31, 2024
13 checks passed
@CamronStaley CamronStaley deleted the docs/cache-control branch July 31, 2024 15:55
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