Bird
0
0

You wrote this Remix loader:

medium📝 Debug Q14 of 15
Remix - Performance
You wrote this Remix loader:
export async function loader() {
  return new Response('Data', {
    headers: { 'Cache-Control': 'max-age=abc' }
  });
}

What is the problem with this caching header?
Amax-age value must be a number, 'abc' causes an error or ignored cache
BCache-Control header name is case sensitive and must be lowercase
CResponse body must be JSON, not a string
DHeaders object must be outside the Response constructor
Step-by-Step Solution
Solution:
  1. Step 1: Check max-age value type

    max-age expects a numeric value representing seconds; 'abc' is invalid and will cause the header to be ignored or cause errors.
  2. Step 2: Validate header name and usage

    Cache-Control header is case-insensitive, so casing is not an issue; Response body can be string; headers object is correctly placed.
  3. Final Answer:

    max-age value must be a number, 'abc' causes an error or ignored cache -> Option A
  4. Quick Check:

    max-age requires numeric seconds [OK]
Quick Trick: max-age must be a number, not text [OK]
Common Mistakes:
MISTAKES
  • Thinking header name is case sensitive
  • Believing body must be JSON
  • Misplacing headers object

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Remix Quizzes