Cache configuration not working correctly #15126
Labels
area: bug 🐛
$$ bug-bounty $$
https://www.jhipster.tech/bug-bounties/
theme: cache
theme: java
$100
https://www.jhipster.tech/bug-bounties/
Milestone
Overview of the issue
I am using jhipster-sample-app-gradle and started it with Spring profile
prod
. Most files are served withCache-Control: no-store
. It seems the only file where the cache configuration is working isi18n/en.json
which is served withCache-Control: max-age=126230400, public
.So I believe the issue is:
static/content
is not cachedstatic/app
anymore but directly tostatic/
while the cache configuration inStaticResourcesWebConfiguration
still configures a policy forclasspath:/static/app/
Motivation for or Use Case
Caching makes the application more performant.
Reproduce the error
src/main/docker/mysql.yml
or configure h2 to start withprod
profileprod
profilehttp://localhost:8080/
and observe that onlyen.json
is configured to be cachedRelated issues
#11575
Suggest a Fix
With the following configuration more files have a cache control header set. However, this will also cache
service-worker.js
and I'm not sure if it's okay.JHipster Version(s)
7.0.1
JHipster configuration
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment (build 16.0.1+9-24)
OpenJDK 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
git version 2.31.1.windows.1
node: v15.12.0
npm: 7.8.0
Docker version 20.10.5, build 55c4c88
docker-compose version 1.29.0, build 07737305
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
The text was updated successfully, but these errors were encountered: