The use of the ESP8266 in the world of IoT

User avatar
By bkrajendra
#4738
alonewolfx2 wrote:It's too slow :(

Its fixed now!
Im using GZIP compressed js and css now
make following changes to make it work.

in httpd.c:
Code: Select allstatic const MimeMap mimeTypes[]={
   {"htm", "text/htm"},
   {"html", "text/html"},
   {"css", "text/css"},
   {"js", "text/javascript"},
   {"txt", "text/plain"},
   {"jpg", "image/jpeg"},
   {"jpeg", "image/jpeg"},
   {"png", "image/png"},
   {"gif", "image/gif"},
   {"ico", "image/x-icon"},
   {NULL, "text/html"}, //default value
};


in httpdespfs.c:
Code: Select all      
char *url;
      url = connData->url;
      //Go find the extension
      char *ext=url+(strlen(url)-1);
      while (ext!=url && *ext!='.') ext--;
      if (*ext=='.') ext++;

      if (os_strcmp(ext, "css")==0 || os_strcmp(ext, "js")==0)
      {
         httpdHeader(connData, "Content-Encoding", "gzip");
      }


enjoy!
You do not have the required permissions to view the files attached to this post.
User avatar
By alonewolfx2
#4742 its faster than old one. but bootstrap.css is 115kb :) i am looking small ui alternatives like pure( >20kb )