-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[online_image] support HTTP caching #4906
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
base: next
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next
branch and rebase.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
✅ Deploy Preview for esphome ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
""" WalkthroughThe documentation for the Changes
Sequence Diagram(s)No sequence diagram generated since the changes are limited to documentation updates. Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)`**`: - Do not generate or add any sequence diagrams
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (2)
components/online_image.rst (2)
69-72
: Improve clarity and formatting of caching documentation.The newly added paragraphs have a few issues:
- Redundant explanation: line 71 repeats line 69.
- Awkward phrasing (“Caching is done following using”).
- Inconsistent literal markup for booleans (
true
vstrue
).- Invalid RST hyperlink syntax for the HTTP caching reference.
Apply this diff to remove redundancy, fix formatting, and use a proper RST link:
@@ -69,4 +69,7 @@ - The variable ``x`` is a boolean argument that can be used in :ref:`lambdas <config-lambda>`. It will be ``true`` when a new image was downloaded (cache miss) and ``false`` when there is a cache hit. Caching is done following using `HTTP request caching https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching` with ``Last-Modified-Date`` and ``ETag``. - `true` when a new image is downloaded (cache miss); it's `false` when there is a cache hit. + The variable ``x`` is a boolean available in :ref:`lambdas <config-lambda>` that indicates cache status: + - ``true`` if the image was freshly downloaded (cache miss). + - ``false`` if the image was loaded from cache (cache hit). + Caching follows standard HTTP mechanisms (see `HTTP caching <https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching>`_), utilizing the ``Last-Modified`` and ``ETag`` headers.
67-72
: Consider adding a usage example forx
in a lambda.While the text explains what
x
means, a concrete YAML snippet demonstrating how to checkx
inon_download_finished
would help users adopt the feature. For example:- on_download_finished: lambda: |- if (x) { ESP_LOGD("online_image", "Cache miss: fresh download"); } else { ESP_LOGD("online_image", "Cache hit: using cached image"); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/online_image.rst
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**`: - Do not generate or add any sequence diagrams
**
: - Do not generate or add any sequence diagrams
components/online_image.rst
ceb969b
to
26a7b4c
Compare
@coderabbitai full review |
3605a77
to
f2ac9da
Compare
Description:
Document
online_image
's support for HTTP response caching.Checklist:
I am merging into
next
because this is new documentation that has a matching pull-request in esphome as linked above.or
I am merging into
current
because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.Link added in
/components/index.rst
when creating new documents for new components or cookbook.