0

We have a large website whith 100's of thousands of products and I am trying to incorporate some http status code caching so that search engines do not try and scan the pages if they have not changed.

Usually you can do this be applying a 304 status code.

However I have a strange issue in that when I output the following in my controller it does not work. I get a blank white screen.

    return response('Hello World', 304)
    ->header('Content-Type', 'text/html');

But when I use 404, 200 etc... It works.

    return response('Hello World', 200)
    ->header('Content-Type', 'text/html');

It's probably something really simple that I am overlooking. Perhaps something to do with Apache... But I am unsure at this point.

I wonder if anyone could help.

Thinkpad
  • 101
  • 1
  • 8
  • 2
    You can't just blindly send a 304 like that. A 304 has no body; a white page is the correct result if you sent a 304 and the browser doesn't have a cached page. – ceejayoz Oct 05 '22 at 13:38

0 Answers0