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

fix: bandwidth issues for 404 resources #6302 #6341

Merged
merged 9 commits into from
May 20, 2024

Conversation

okikio
Copy link
Contributor

@okikio okikio commented May 20, 2024

Overview

fixes #6302

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

This PR fixes a bug that causes high bandwidth usage for the 404 response for static resources. The issue is detailed in Issue #6302. The changes made in this PR ensure that the middleware uses a static error message for static resources, thus reducing the unnecessary bandwidth consumption.

Summary of changes:

  1. Modified middleware to return a static "Not Found" message for static resources.
  2. Added comments to the code documenting the necessity of these changes.
  3. Included tests to verify the fix and ensure consistent behavior.

Use cases and why

  • High bandwidth usage: When static resources result in a 404 error, the response was consuming high bandwidth. This fix reduces the bandwidth usage by using a static message.
  • Consistent error messaging: Ensures that static resources always return a consistent "Not Found" message, improving the clarity and predictability of the 404 responses.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Signed-off-by: Okiki <hey@okikio.dev>
Copy link

netlify bot commented May 20, 2024

👷 Deploy request for qwik-insights pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 329f490

@PatrickJS PatrickJS merged commit a6a8525 into QwikDev:main May 20, 2024
22 checks passed
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.

[✨] Automatic simple 404 responses for file requests
2 participants