ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By bkrajendra
#4689
Sprite_tm wrote:Wow, 250K for only the Bootstrap framework... I use some Javascript/AJAX too for the WiFi selector, but the only 'library' I use is 140medley which totals to a whopping 825 bytes. Which is useful, I wouldn't want to delete the cat pictures :P


Unfortunately yess!! :) Bootstrap is professional web and mobile CSS-JS framework for app design.
But there are minimalistic alternative. take a look at these:

http://responsivebp.com

Complete list: http://codecondo.com/minimal-css-frameworks-grid-systems/

"Min" is really promising - only 995 byte!
User avatar
By bkrajendra
#4739 Slow loading problem fixed now.

size issue fixed by gzip!
Im using GZIP compressed js and css now
make following changes to make it work.

in httpd.c: (This is just to make gif work)
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: (adding Content-Encoding header.. i hope its the right place to add? :D )
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 prozac
#4773 FYI, using the esp-open-sdk, the code as is seems to throw a warning about using a char as an array index in the base64.c file (if(isspace(in[ii])). By declaring another char and assigning in[ii] to that char and using that in the subsequent lines, the warning goes away. Not sure if s the compiler or what, but thought you should know in case someone else gets tripped up.