Using cache manifest for a Arduino Server Website

Hello everyone,
i have an Arduino Mega with a WiFi Shield connected which serves a Website to controll a few switches. Now i would like to make the Website being cached on the device that it is accessed by. I have tryed to add this to my code but couldnt get it to work. Now my question is if this is even possible and if so how do i do this. Here are the things i tried:
Arduino Code Part:

if (StrContains(HTTP_req, "GET /manifest.appcache")) {

                    client.println("HTTP/1.1 200 OK");
                    client.println("Content-Type: text/cache-manifest .appcache");
                     client.println("Connection: keep-alive");
                    client.println();


                    
}

HTML Part:

<html manifest="manifest.appcache" >

I also have the Manifest File on the SD Card with the following content:

CACHE MANIFEST
index.htm

I have always only Posted the Parts that i think are relevant for what i want.
Thanks in advance

Now i would like to make the Website being cached on the device that it is accessed by.

That might be a browser setup option.

Hi, It is not a browser related problem because i tested a example website and that worked perfectly. The thing is that i dont know at all how to make the arduino webserver handle the manifest file. All examples that i found were always refering to real servers. So i dont know even if its possible with the arduino webserver.

You want to cache only the index.htm file? Why don't you use regular caching?

if (StrContains(HTTP_req, "GET /index.htm")) {
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
// this caches the file for 24 hours
  client.println("Cache-Control: max-age=86400");
  client.println();

Thank you for your suggestion. That is exactly what i want and way easier than what i found. I only want to cache the index.htm file because i have the css and javascript included in it in / Tags. But in case some time i want to make seperate files for the css/js in order to cache it i just have to add the cache control max age to each files header and it will enable me to cache it? Alright im trying it out now.

I modified my server code to use cache on certain file types, including js and css. Here is the server code [Here are the cache changes](http://forum.arduino.cc/index.php?topic=341692.msg2362360#msg2362360\)

So i decided to use your Sketch now for the Server since its faster and more responsive and i set up everything for my use. (used to be a lot fast in the beginning and slowed down a bit as i kept using it for a reason that i dont know). I also read up a little bit on the Link you have posted and now i guess i understand why i thought it would not cache anything. It will not cache when you refresh or reload the website. Only by using the back and forth buttons. That is a little bit annoying but i guess i ll have to live with it. So thanks again for helping me

joe-hannes: It will not cache when you refresh or reload the website. Only by using the back and forth buttons. That is a little bit annoying but i guess i ll have to live with it.

That is correct. That is what you can expect when you click a button that says "Reload" or "Refresh". I find that to be useful if I am testing and want it to reload those files because I have changed them.