John Raptis
John Raptis

Reputation: 197

Making a web page cache even if the parameters change

Is there a way to get a browser to cache a web page even if the parameters change?

I have a web assembly app that takes parameters. If the parameters change, the browser forces a download. Is there any way I can set headers so that the parameters aren't a factor in caching?

i.e. if I do

http://www.example.com?param=1234

and

http//:www.example.com?param=4321

...the browser thinks it's a whole new site and downloads the whole 26mb web assembly binary again.

Anything I can do?

Upvotes: 1

Views: 443

Answers (1)

Chtiadrien
Chtiadrien

Reputation: 56

You can use the Cache-Control header:

<?php

header("Cache-Control: public, max-age=604800, immutable");

Upvotes: 1

Related Questions