Chat freely about anything...

User avatar
By treii28
#53838
martinayotte wrote:I don't understand why you would need streaming and why are you talking about recursion ...
[/code]


OH, I'm no doubt running into other errors. I was using the recursion since the process of reading any one directory is essentially the same as reading any sub-directory, thus I called back on the same function to read the sub directory. I decided to go to the file output just because caching allows the server code itself to be more responsive rather than taking time out to do the same work over and over again.

I bugged one of the former C++ programmers at work and think I know how to pass the File handle around now, I just haven't had time to try it yet. I'm still curious to know why the jquery call never seems to complete though, but I've had to do some other things while stress testing the capability of these servers such as using a javascript lazy-loader and compressing the .js and .css files to get them to both load completely and do so in a timely fashion. (I was curious to see how long it would take on these little guys to load a full code suite including jquery, bootstrap, angularjs and sundry other scripts. Uncompressed it was taking up to a minute to load everything. Compressed I got them down to about 15-20 seconds. But concurrent connections seemed to fail occasionally, generally with the first file [bootstrap.css] not loading completely. It would freeze as the others started to load and then resume but not load correctly. I then tried combined them all into a single file, minified them and compressed them, and that I got it down to 10-12 seconds. But I still needed to load the bootstrap.css separate and it was still dropping chunks - so I went to using the lazy loader to make sure they loaded sequentially)

Now that my playing with top-heavy pages is done, I'm probably going to strip it all out and go back to basics using all native code and only the bare minimum functionality I need to get the job done. You can get lazy on big web servers with fast connections and load more than you need.
User avatar
By treii28
#53883
martinayotte wrote:ESP8266WebServer isn't efficient when there are multiple simultaneous requests.
That's one reason that @me-no-dev wrote the ESPAsyncWebServer.


Yeah, I looked at that but with my limited (but growing) knowledge of C/C++ I'm going to need more time than I have available on this project to figure all that out. I also want to learn to use the improved SdFile code at some point to handle better file moves and long file names and such.

I started ripping out my 'stress test' versions of the HTML to just use old-school barebones javascript calls to xmlhttprequest and I seem to be getting better results. My problems started occurring when I started lazy-loading jquery and the other stuff so I suspect something in there is causing my headaches with the json calls.

I just posted some of my modifications to the SD Webserver code in the Examples forum. I have lots of other stuff now in my code so I didn't bother posting the entire file since the stuff that is useful is just variations on the original code. But I also included my javascripted 'upload' that modifies the action parameter in the form so you can send the parameters along with the upload. Ahhhhh, it's so nice not having to remove the SD card any time I want to modify a file that's not in the root directory!