GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enhancement proposal: use Undertow's built-in handlers to serve static content · Issue #1346 · ArcadeData/arcadedb

Enhancement proposal: use Undertow's built-in handlers to serve static content #1346

New issue
Copy link
New issue
Copy link
Closed
Closed
Enhancement proposal: use Undertow's built-in handlers to serve static content#1346
Copy link
Assignees
lvca
Labels
performancewontfixThis will not be worked on

Description

@vic0824
vic0824
opened on Nov 24, 2023
Issue body actions

Currently, a dedicated handler exists (GetDynamicContentHandler) for serving static content.
In case it is considered useful, another approach would be to assess the feasibility of using the Undertow's built-in handlers to serve static content, in particular the ResourceHandler.
Advantages: slight reduction of code-base size, possibility of caching on server side, slightly better performance (the Undertow implementation uses a statically initialized map of mime types, thus avoiding a long chain of if-then-else).
Disadvantages: not so easy to serve the html files in response to an http request that does not end with .html (at least so far I wasn't able to do it). I also didn't have time to find out if the Undertow handlers can handle also the templating part of GetDynamicContentHandler

The ResourceHandler can be added to the routes like this:

final int cacheTime = 86400; // seconds
ResourceManager classPathManager = new ClassPathResourceManager(HttpServer.class.getClassLoader(), "static");
ResourceManager resourceManager = new CachingResourceManager(100, 65536,
        new DirectBufferCache(1024, 10, 10480), classPathManager, cacheTime);
ResourceHandler resourceHandler = new ResourceHandler(resourceManager);
resourceHandler.setCachable(Predicates.truePredicate());
resourceHandler.setCacheTime(cacheTime);
final PathHandler routes = new PathHandler();
routes.addPrefixPath("/", resourceHandler);

and the html file must be included in the http request: http://[hostname]:[port_number]/index.html

Activity

  1. lvca commented on Nov 24, 2023

    @lvca
    lvca
    on Nov 24, 2023
    Member
    More actions

    @vic0824 if you can find a way to make it work, I'd be happy to evaluate the switch. Or if you are using ArcadeDB to serve your static pages too, what about using the default handler for those in your app where you need more speed?

    In the case of ArcadeDB, it's only for Studio, so it's not a big deal.

  2. lvca
    added
    performance
    on Nov 24, 2023
  3. vic0824 commented on Nov 25, 2023

    @vic0824
    vic0824
    on Nov 25, 2023
    Author
    More actions

    GetDynamicContentHandler is absolutely fine, there's nothing wrong with it.
    In my project, I have created a new branch which uses MariaDB, to experiment with geometry types, and it seemed strange that I had to write my own handler for such a common task as serving static content, so I did a bit of research and found a way to do it with a few lines of code using the Undertow's ResourceHandler, and I wanted to share this info.
    There is no real need to modify the current ArcadeDB handler.

    Reacted by Luca Garulli
  4. vic0824
    closed this as completedon Nov 25, 2023
  5. lvca
    self-assigned this
    on Nov 25, 2023
  6. lvca
    added
    wontfixThis will not be worked on
    on Nov 25, 2023
  7. mergify
    added a commit that references this issue on Aug 10, 2025

    chore(deps): bump jline.version from 3.30.4 to 3.30.5 [skip ci]

    e7e2b7e
  8. mergify
    added a commit that references this issue on Mar 15, 2026

    chore(deps): bump neo4j-driver from 5.28.3 to 6.0.1 in /e2e-js [skip ci]

    2781a15
  9. mergify
    added 2 commits that reference this issue on May 31, 2026

    chore(deps-dev): bump testcontainers from 12.0.0 to 12.0.1 in /e2e-js…

    1fcdd13

    chore(deps-dev): bump testcontainers from 12.0.0 to 12.0.1 in /e2e-st…

    e21790d
  10. tae898
    added 4 commits that reference this issue on Jun 28, 2026

    chore(deps): bump jline.version from 3.30.4 to 3.30.5 [skip ci]

    b77173f

    chore(deps): bump neo4j-driver from 5.28.3 to 6.0.1 in /e2e-js [skip ci]

    f98d768

    chore(deps-dev): bump testcontainers from 12.0.0 to 12.0.1 in /e2e-js…

    d50bea5

    chore(deps-dev): bump testcontainers from 12.0.0 to 12.0.1 in /e2e-st…

    520f149
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvca
    lvca

Labels

performancewontfixThis will not be worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.