@user1980 could you try clearing your browser cache?
Jul 6, 2021
11
Level 4
http/1.0 302 Found Cache-Control: no-cache,private redirect issue
Hello,
No idea if you ever had this issue but when my users click a link via email, they hit this URL:
https://xxxxxxx.com/ad/expired/9410
The controller is then reached:
Route::get('/ad/expired/{id}', 'Common\adController@expires');
And this is returned:
return redirect()->route('ads');
It looks like the return redirect causes a blank page (for 1 second) with the below message:
http/1.0 302 Found Cache-Control: no-cache,private redirect issue
Just before the correct page shows up.
Any idea why please?
Thanks
Level 1
@Sinnbeck Sry forgot to Login in Laracast. In my case the Issue pops out because I've had a function in my controller like this:
//FalseController.php
public function some(): string
{
return redirect()->route('home');
}
Then this redirect Issue exists because the return type of the function is set as string but the function returns a redirect.
Just fixed the issue by removing the : string from my function. Like that:
//RightController.php
public function some()
{
return redirect()->route('home');
}
//or replacing it by the redirect-type (didnt know the namespace right now)
Hope that helps.
5 likes
Please or to participate in this conversation.