Payara caching gzipped files?

Hello everybody,

i tried searching the forum, but i wasn’t able to find the fitting question.

We have microservices using payara micro. These services usually service some additional static files (main.js, some css).

The payara will receive quite some load and we are “afraid” that it will “recompress” these files again and again. The main.js file is around 2.6mb.

We want to use these settings:
configs.config.server-config.network-config.protocols.protocol.${protocol-name}.http.compression
configs.config.server-config.network-config.protocols.protocol.${protocol-name}.http.compressable-mime-type

So my question is:

  • Is payara micro caching the compressed files somewhere (ram/hdd)?

thank you very much in advance,

Bernhard

Hi, you can enable file-based caching for all static resources, including gzipped javascript files: Tuning the GlassFish Server.

In Payara Micro, you can configure this in a pre-boot command file with the following set commands:

set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cache.enabled=true
set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cache.max-age-seconds=30
set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cache.max-files-count=1024
set configs.config.server-config.network-config.protocols.protocol.http-listener-1.http.file-cache.max-cache-size-bytes=10485760

Ondro

2 Likes

Thank you very much!