Support the ongoing development of Laravel.io →
posted 8 years ago
Views

I'm using the following, but this header is not set.

return Response::view('doNotWantCachingOnThis')
                ->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true);

I can set any other header I wish.

Why is Laravel ignoring/overwriting this one?

It appears that only this view, and only in Chrome, is retrieved from the browser cache, so I'm trying to force it to always re-download it.

Last updated 3 years ago.
0
Solution

Turns out I can use the following

->header('Expires', '0', true)
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jezmck jezmck Joined 24 Apr 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.