#51 2019-12-05 15:18:45

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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

#52 2019-12-05 16:03:55

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Thanks Eugene!

Offline

#53 2019-12-20 21:14:31

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

@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

#54 2020-01-09 15:47:32

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

@macfly,
Thanks! Merged with slight changes in batch script.

Offline

#55 2020-10-06 19:51:37

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Release 2.3
  • 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

#56 2020-10-06 20:26:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

1490 MIME types... big_smile

Offline

#57 2020-10-06 20:57:53

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Really!

Even for those who do not use the framework it is a good reference material.

Offline

#58 2020-10-06 21:27:26

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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 smile

IANA Media Types

Last edited by Eugene Ilyin (2020-10-06 22:59:23)

Offline

#59 2020-10-08 16:44:52

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Just for information - we use mime-db for mime types. There are a ready to use JSON there and also a scripts to create it.

Offline

#60 2020-10-08 17:41:43

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Thanks Pavel, it's great alternative to default MIME types list!

Offline

#61 2020-11-19 21:50:52

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Release 2.4
  • 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

#62 2020-12-17 09:03:38

damiand
Member
From: Greece
Registered: 2018-09-21
Posts: 94

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

I've downloaded release 2.4 (thanks Eugene smile ) 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. hmm

Last edited by damiand (2020-12-17 12:31:26)

Offline

#63 2020-12-17 12:58:47

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

@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

#64 2020-12-21 13:00:40

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

@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

#65 2020-12-21 13:58:30

damiand
Member
From: Greece
Registered: 2018-09-21
Posts: 94

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Eugene Ilyin wrote:

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! smile Thanks also macfly for your kind suggestion.

Offline

#66 2021-05-17 08:19:21

htits2008
Member
Registered: 2015-03-25
Posts: 34

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

someone show me a sample with a lots of  details?

Offline

#67 2021-05-19 21:00:04

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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

#68 2022-01-11 19:23:44

Lauri
Member
From: Under a rock
Registered: 2020-12-05
Posts: 25

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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

#69 2022-01-11 20:09:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Great news!

Why not a pull request in the original project?
Or at least publish your fork on github?

Offline

#70 2022-01-11 21:23:24

Lauri
Member
From: Under a rock
Registered: 2020-12-05
Posts: 25

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Because i live under a rock and don't have a Github account smile
An e-mail with a link could be arranged to someone willing to do it.

Offline

#71 2022-01-25 04:55:36

Eugene Ilyin
Member
From: milky_way/orion_arm/sun/earth
Registered: 2016-03-27
Posts: 132
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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 smile

Offline

#72 2022-08-01 03:06:13

htits2008
Member
Registered: 2015-03-25
Posts: 34

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

Are there new version by M2?

Offline

#73 2024-01-04 09:58:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Memcached Boilerplate HTTP Server for Synopse mORMot Framework

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? wink

Offline

Board footer

Powered by FluxBB