user1606295
user1606295

Reputation: 3

Does PHP Header Redirect forces browser to reload images and not use cached images

It looks like when we redirect a user to a page using following code

header("Location: www.somewebsite.com");

then the images(like logo, bullets etc.) are reloaded from server and cached on the computer are not used.

is it so? if yes, how can tell the browser to use just cached images only.

Upvotes: 0

Views: 230

Answers (2)

tuxtimo
tuxtimo

Reputation: 2790

No, the header-function has no effect in caching... But have you something like this somewhere on your page:

header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");

Because something like this will deactivate your caching... The cache is on the client (browser) and this has nothing to do with your redirect.

Upvotes: 0

derki
derki

Reputation: 620

header does not anything with that, images has their own headers with cache expirations, you need to add cache headers to those images directly through web server or by some script

Upvotes: 2

Related Questions