[UNSOLVED] help 404 error for iconfont woff2 file on ESP32 Asyncwebserver

I'm creating smart home system (webserver based) on a ESP32 .
I'm serving from SPIFF and with Asyncwebserver,

HTML & CSS files works simply, but woff2 (iconfont file) , cache-manifest .mf files aren't handled.
Don't know what i am doing wrong.
.

I've already tested other parts of code the GET method works perfectly.
Everything works except this part.

UPDATE : everything works now except the .woff2 font file returns with 404.

server.on("/iconfont/material-iconsdata.woff2", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(SPIFFS, "/iconfont/material-iconsdata.woff2", "application/font-woff2 .woff2");
  });

Lastly, as the cache-manifest is being depricated, can someone suggest an alternative to this.

    request->send(SPIFFS, "/iconfont/material-iconsdata.woff2", "application/font-woff2 .woff2");

The last parameter is not a mime type.

    request->send(SPIFFS, "/cache.mf", "text/cache-manifest .appcache");

Same applies here.

The last parameter is not a mime type.

    request->send(SPIFFS, "/cache.mf", "text/cache-manifest .appcache");

So this should work ?

   request->send(SPIFFS, "/cache.mf", "text/cache-manifest");

But what about the one in JavaScript?

Will post after trying

But what about the one in JavaScript?

Post complete code, the error may be somewhere else in the code! BTW, you might ommit the mime type for the javascript file because the library will choose that type anyway for files ending in .js.

pylon:
Post complete code, the error may be somewhere else in the code! BTW, you might ommit the mime type for the javascript file because the library will choose that type anyway for files ending in .js.

Doing that didn’t worked.
BTW here is the full code
Please have a look.

wifiAPspiffserver.ino (2.98 KB)

pylon:
Post complete code, the error may be somewhere else in the code! BTW, you might ommit the mime type for the javascript file because the library will choose that type anyway for files ending in .js.

Problem solved for javascript files, I did a very dumb mistake.

But .woff2 files now return 404 status code, dunno why, I’ve double checked the spiff storage.

Here’s the updated code, with the woff2 error.

wifiAPspiffserver.ino (3.15 KB)

But .woff2 files now return 404 status code, dunno why, I've double checked the spiff storage.

404 status code means the file doesn't exist. Did you check that the exact same file name exists (case does matter!)?

pylon:
404 status code means the file doesn't exist. Did you check that the exact same file name exists (case does matter!)?

Yup, I did copy exact same filenames both in the code and SPIFF and in the request header (issued through material-icons.css ) but no luck.

Nevermind I switched to PNG icons ( I just needed 3 icons lol ). Better than loading a 50KB iconfone file over and over again.

Any tips on reducing jquery.min.js file size ?
I cant rewrite my script in pure JavaScript as I'm using some jQuery only implementations.

Any tips on reducing jquery.min.js file size ?

You can gzip it and call it jquery.min.js.gz, then it will be delivered appropriately.