Skip to content

Commit

Permalink
YKI:AKR:OTR:VKT(Frontend & Backend): OPHKIOS-21 Cache headereiden kor…
Browse files Browse the repository at this point in the history
…jaus (#647)

* VKT(Frontend & Backend): Asset cache experiment [deploy]

* YKI:AKR:OTR:VKT(Frontend & Backend): cache fix [deploy]

* YKI:AKR:OTR:VKT(Frontend & Backend): cache for 30 days [deploy]
  • Loading branch information
jrkkp authored Mar 5, 2024
1 parent 71e8c5b commit c841415
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
7 changes: 6 additions & 1 deletion backend/akr/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ spring:
web:
resources:
static-locations: classpath:static/
cache:
cachecontrol:
max-age: 30d
chain:
cache: true
thymeleaf:
prefix: classpath:static/
templateResolverOrder: 1
Expand Down Expand Up @@ -67,4 +72,4 @@ app:
service-url: ${onr.service-url:https://virkailija.untuvaopintopolku.fi/oppijanumerorekisteri-service}
cas:
username: ${onr.cas.username:auktorisoitujenkaantajienrekisteri}
password: ${onr.cas.password:password}
password: ${onr.cas.password:password}
5 changes: 5 additions & 0 deletions backend/otr/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ spring:
web:
resources:
static-locations: classpath:static/
cache:
cachecontrol:
max-age: 30d
chain:
cache: true
thymeleaf:
prefix: classpath:static/
templateResolverOrder: 1
Expand Down
5 changes: 5 additions & 0 deletions backend/vkt/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ spring:
web:
resources:
static-locations: classpath:static/
cache:
cachecontrol:
max-age: 30d
chain:
cache: true
thymeleaf:
prefix: classpath:static/
templateResolverOrder: 1
Expand Down
5 changes: 5 additions & 0 deletions backend/yki/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ spring:
web:
resources:
static-locations: classpath:static/
cache:
cachecontrol:
max-age: 30d
chain:
cache: true
thymeleaf:
prefix: classpath:static/
templateResolverOrder: 1
Expand Down
4 changes: 2 additions & 2 deletions frontend/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = (appName, env, dirName, port, entryPage = "etusivu") => {
const getEntry = () => ({ entry: path.join(dirName, "src", "index.tsx") });
const getOutput = () => ({
output: {
filename: `${STATIC_PATH}/js/bundle.js`,
filename: `${STATIC_PATH}/js/[name].[contenthash].js`,
path: path.join(
dirName,
"..",
Expand All @@ -36,7 +36,7 @@ module.exports = (appName, env, dirName, port, entryPage = "etusivu") => {
algorithm: "gzip",
}),
new MiniCssExtractPlugin({
filename: `${STATIC_PATH}/css/[name].css`,
filename: `${STATIC_PATH}/css/[name].[contenthash].css`,
}),
new CopyPlugin({
patterns: [
Expand Down

0 comments on commit c841415

Please sign in to comment.