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

Non-Existent Images serving Placeholder Image return 200 Status instead of 404 Status affecting CDNs/Edge Servers/Browser Cache #39174

Open
1 of 5 tasks
AndresInSpace opened this issue Sep 17, 2024 · 2 comments
Labels
Issue: ready for confirmation Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.

Comments

@AndresInSpace
Copy link

AndresInSpace commented Sep 17, 2024

Preconditions and environment

M2 2.4.7-p2
Add assets for default placeholder images.
Set through configuration/admin panel.
Ensure placeholders are used if image does not exist.

Steps to reproduce

make a request for a bogus image path you know will fail and return placeholder image

Expected result

Placeholder response and 404 status code
edge caches/image cdns/browsers/etc are caching image correctly based on 404 status code resulting in an extremely short cache expiration time set and for image delivery networks the master image source is not considered set.

Actual result

Placeholder response and 200 status code
edge caches/image cdns/browsers/etc are caching placeholder image incorrectly based on 200 status code resulting in (usually) very long cache expiration times set and for image delivery networks the master image source is now considered set.
vanilla-200-status-for-failed-and-placeholder-returned-should-be-404

Additional information

A 404 status code should be set when an image request is not found, but response is sent using placeholder data.

Live Example:
curl https://i4.ytimg.com -i
You will see response code is 404, but browser still utilizes response data to render the image based on standards. https://html.spec.whatwg.org/#images-processing-model

I believe S2 status is warranted since these are 404 placeholders, ie non-critical, and we have to employ a workaround to ensure we are not incurring extra costs from our CDNs (ie monitor and purge master source assets in CDNs being created from fake 200 placeholder responses).

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Sep 17, 2024

Hi @AndresInSpace. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

@AndresInSpace AndresInSpace changed the title Non-Existent Images serving Placeholder Image return 200 Status instead of 404 Status affecting CDNs/Edge Servers Non-Existent Images serving Placeholder Image return 200 Status instead of 404 Status affecting CDNs/Edge Servers/Browser Cache Sep 17, 2024
@engcom-Bravo engcom-Bravo added the Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. label Sep 17, 2024
@AndresInSpace
Copy link
Author

vanilla-200-status-for-failed-and-placeholder-returned-should-be-404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: ready for confirmation Reported on 2.4.7-p2 Indicates original Magento version for the Issue report.
Projects
Status: Ready for Confirmation
Development

No branches or pull requests

2 participants