Replies: 5 comments 1 reply
-
Additional info... If I clear the cache the index page takes 2-3 secs to load. |
Beta Was this translation helpful? Give feedback.
-
As I see from your code your handling of static content (js/css) is horribly wrong. You spawn a decompressor to ungz the data into string then feed to the server as a stream, it is very mem hungry in inefficient. You can just feed compressed data to the browser with |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
another hint - you can use predefined literals from the webserver header and save some bytes of your code Also you should not use |
Beta Was this translation helpful? Give feedback.
-
Thanks vortigont. The compiler reminded me of that when I tried to test. 😆 I now have this working. I had to change the format of the compressed data for the static files from zlib to gzip which was a fairly simple change. I will definitely take a look at the predefined literals. We are just heading towards our first full release so code optimisation is high on the agenda. Thanks for your very prompt help. It is very much appreciated. 😄 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi all. great to see some movement with this library. It is a truly great resource that really deserves it.
I've decided to migrate my project from the old me-no-dev/ESPAsyncWebServer library (actually the esphome/ESPAsyncWebServer-esphome fork) to this one but have come across a couple of issues.
The first one was an error thrown on compilation relating to const declaration...
I resolved this by adding the const keyword to the declaration, I assume that this is okay.
This allowed the project to compile with a few warnings about deprecated methods, which I also resolved...
However when running the project, trying to access the webpage just hangs. The page appears to start loading, I can see the HTML source come in, but it hangs on the CSS and Javascript files.
Eventually after some time I get a WD error reported to the serial monitor...
So looks to be an issue with async_tcp.
The project works fine with the old library.
My test code can be found HERE
The only changes from the working code are as described above and shown HERE
Any help resolving this would be very much appreciated.
Cheers.
/DM
Beta Was this translation helpful? Give feedback.
All reactions