Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide property to indicate the index page for static resources #15320

Closed
brunolmfg opened this issue Feb 24, 2021 · 3 comments · Fixed by #30068
Closed

Provide property to indicate the index page for static resources #15320

brunolmfg opened this issue Feb 24, 2021 · 3 comments · Fixed by #30068
Labels
kind/enhancement New feature or request
Milestone

Comments

@brunolmfg
Copy link
Contributor

Description

Providing a configuration property to indicate the index page for static resources will allow use a different filename. This is only possible with undertow extension using the welcome-file-list entry on web.xml. The vertx-http extension could provide an option like this:

quarkus.http.index-page=/default.html

Implementation ideas

The static resources are provided by VertX Web using StaticHandler that only accept one filename definition. So the new config property will define the indexPage attribute of the created StaticHandler for the static resources in src/main/resources/META-INF/resources.

Will need to change the StaticResourcesProcessor and StaticResourcesRecorder to consider the indexPage property at HttpBuildTimeConfig.

@geoand
Copy link
Contributor

geoand commented Dec 23, 2022

@brunolmfg would you be willing to contribute this feature?

@brunolmfg
Copy link
Contributor Author

brunolmfg commented Dec 23, 2022

@brunolmfg would you be willing to contribute this feature?

@geoand I've took a look and some considerations came out. Maybe it's better to create a static-resources configuration group exposing other properties of StaticHandler. Bellow the proposed properties to be exposed and its default values defined in StaticHandler.

quarkus.http.static-resources.index-page=index.html
quarkus.http.static-resources.max-age=24H
quarkus.http.static-resources.max-cache-size=10000
quarkus.http.static-resources.cache-entry-timeout=30S
quarkus.http.static-resources.include-hidden=false

The property quarkus.http.static-resources.index-page require to be a build time configuration because StaticResourcesProcessor registers the paths containing an index page. An alternative would be moving the verification to StaticResourcesRecorder.

I've also observed that an internal StaticResourcesBuildItem is used in StaticResourcesProcessor but a cloned new class was created in #23280 as a SPI, deprecating the former since 2.8.0.CR1. Would be ok remove it?

@geoand
Copy link
Contributor

geoand commented Dec 24, 2022

Maybe it's better to create a static-resources configuration group exposing other properties of StaticHandler

Sounds reasonable.

Would be ok remove it?

I would need to look at the code, but off the tope of my head, I think it makes sense to remove it

@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants