To archive that, you should
- For static components: implement "Never expire" policy by setting far future Expires header
- For dynamic components: use an appropriate Cache-Control header to help the browser with conditional requests. The value is 48 hours.
I am not going to post code here as there are many existing code out there. But, if you have no idea on what to search for, those links below will help