You are not logged in.
macfly,
If your nginx/apache/openlitespeed reverse proxy provides some HTTP header corrections you can use them and disable the related option on mORMotBP side (to skip of doing the same work twice). But from compression perspective (especially for apache http server which is based on thread-per-request model) I suggest to use mORMotBP because you get the maximum possible compression and save CPU/Response time on the reverse proxy side.
Measuring both ways under the expected parallel loads is a good appoach to make a decision.
Offline
Thanks Eugene!
Offline
@Eugene,
I sent a small pull request on git to update the modernizr version at index.html.
Also a contribution of a "pre-build.bat" for Lazarus + Windows
Last edited by macfly (2019-12-20 23:15:31)
Offline
@macfly,
Thanks! Merged with slight changes in batch script.
Offline
Upgrade Assets to HTML Boilerplate v8.0.0
Align options with Apache Server Configs v4.0.0
Upgrade Brotli compression to v1.0.9
Support Dynamic Brotli compression (save about 25% CPU usage compared to GZip on 64-bit systems and 10% less delivery time and traffic utilization).
Add support of 1490 MIME Types file extensions from IANA, Apache, and Mozilla (see BoilerplateAssets.KnownMIMETypes as an alternative to SynCommons.GetMimeContentType)
bpoDelegateUnauthorizedTo404 set content for HTTP 401 "Unauthorized" response code equals to /404
bpoDelegateNotAcceptableTo404 set content for HTTP 406 "Not Acceptable" response code equals to /404
bpoDelegateHidden block access to all hidden files and directories except for the visible content from within the /.well-known/ hidden directory
bpoDisableTRACEMethod prevents TRACE requests being made via JavaScript
TStrictSSL supports strictSSLIncludeSubDomainsPreload
New DNSPrefetchControl property controls DNS prefetching
TAssets.SaveToFile now forces file directories before save and returns boolean success value
assetslz didn't store compressed content if it size is greater than the size of the identity content (which prevents unnecessary bundle increase)
Last edited by Eugene Ilyin (2020-10-06 23:07:42)
Offline
Really!
Even for those who do not use the framework it is a good reference material.
Offline
Yeap,
It was an intresting challenge to fetch, parse, combine, deduplicate and prioritize ~2000 IANA documents merge with Apache and Mozilla versions and provide them as an O(1) hash list of TSynNameValue values
Last edited by Eugene Ilyin (2020-10-06 22:59:23)
Offline
Thanks Pavel, it's great alternative to default MIME types list!
Offline
Add TBoilerplateHTTPServer.OnGetAsset for external, computable assets and files with custom redirections support.
This is usefull for:
Dynamically compute content.
Return custom redirects for any request, now you can run projects migration, A/B testing, synthetic/deprecated links support, etc.
Precache rare updated dynamic content and compress it with GZip, Zopfli, or Brotli.
Customize transfer of any stored files or save some dynamic content to files and delegate transfer to low-level HTTP API.
Change TAsset.Timestamp type to TUnixTime for better perfomance and modifications checks
Add TAssset.Clear and TAssset.Assign methods
Last edited by Eugene Ilyin (2020-11-20 17:19:10)
Offline
I've downloaded release 2.4 (thanks Eugene ) and built and run the Demo in Linux x64 with FPC 3.2.0 / Lazarus 2.0.9. When the application is shutting down (after pressing the Enter key), it raises an access violation exception at line 982 of unit mORMotHttpServer, when it attempts to execute
fDBServers[0].Server.EndCurrentThread(Sender);
This happens also in Windows 10 64 bit with FPC/Lazarus but not with Delphi 10.3.
It might have something to do with the usage of IAutoFree, because using a classic try/finally approach doesn't raise any exception.
Last edited by damiand (2020-12-17 12:31:26)
Offline
@damiand
Please see if this thread applies to your case:
https://synopse.info/forum/viewtopic.php?id=5691
Last edited by macfly (2020-12-17 14:08:00)
Offline
@damiand,
There is an easy way to avoid this mORMotHTTPServer exception on FPC:
Detach DBServer/DBServers from your HTTPServer before destruction, like so:
{$IFDEF FPC} HTTPServer.RemoveServer(Server); {$ENDIF}
I've updated the Demo sample, please see this small amendment here.
No exceptions on FPC 3.2.0 / Lazarus 2.0.10 / mORMot 1.18.6186 on Win64.
Please let me know if the issue is gone or still exist on the latest mORMot revision when you add this line to the end of your source code.
Last edited by Eugene Ilyin (2020-12-21 16:25:24)
Offline
Please let me know if the issue is gone or still exist on the latest mORMot revision when you add this line to the end of your source code.
Eugene with your modification the issue is gone, thanks a lot! Thanks also macfly for your kind suggestion.
Offline
someone show me a sample with a lots of details?
Offline
Hi htits2008,
Just get the recent release, follow the instructions and build the Demo project, run HTTP server locally, open the root page and see the headers, GZip/Brotli compression, CSP directives, cache behaviour, static assets etc.
Then play with options and see the results or check how the test cases work.
Then try to build some your favorite front-end: Angular, React, Vue, Svelte, Solid, VanillaJS, play with SSR and experiment with mORMot on-the-fly mustache template engine, etc.
Then connect all of it with your favorite reverse proxy like nginx, openhttplite, CDN, etc.
Fill free to ask if something is not clear.
Offline
Hi!
I've converted the library to use mORMot2. Seems to work and passes included tests. I was wondering maybe someone else is interested...
Last edited by Lauri (2022-01-11 19:28:13)
Offline
Because i live under a rock and don't have a Github account
An e-mail with a link could be arranged to someone willing to do it.
Offline
You can e-mail directly to me (the e-mail is on the end of the library description): eugene.ilyin (at) gmail (dot) com
But right now, I'm working on increasing Brotli/Zopfli compression speed and mem reusage.
Maybe we should create a separate mORMotBP2 project on GitHub
P. S.
Or maybe we can put this library to mORMot as AB suggested couple of years ago
Offline
Are there new version by M2?
Offline
In the next days, I will include some part of mORMot BP into the mORMot 2 trunk.
Not all BP features and its notion of embedded assets, but some core features at HTTP server level - primary its great set of security features.
This will be done in the context of an upcoming web server, similar to https://github.com/caddyserver/caddy but with mORMot performances and a pascal backend.
So, once I have published this integration, perhaps someone may try to publish a mORMotBP2.
I will try to maintain it as compatible as possible.
BTW: no https://github.com/h5bp/html5-boilerpla … tag/v9.0.0 support yet?
Online