1
0
mirror of https://github.com/openvinotoolkit/cvat.git synced 2022-03-09 18:58:10 +03:00

Don't cache index.html (#4277)

This commit is contained in:
Andrey Zhavoronkov
2022-02-03 22:36:13 +03:00
committed by GitHub
parent 29f14a814a
commit f0b2a75125
3 changed files with 15 additions and 6 deletions

View File

@@ -37,6 +37,5 @@ RUN npm run build:cvat-ui
FROM nginx:mainline-alpine
# Replace default.conf configuration to remove unnecessary rules
RUN sed -i "s/}/application\/wasm wasm;\n}/g" /etc/nginx/mime.types
COPY cvat-ui/react_nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=cvat-ui /tmp/cvat-ui/dist /usr/share/nginx/html/

View File

@@ -1,7 +1,17 @@
server {
root /usr/share/nginx/html;
# Any route that doesn't have a file extension (e.g. /devices)
location / {
# Any route that doesn't exist on the server (e.g. /devices)
try_files $uri $uri/ /index.html;
add_header Cache-Control: "no-cache, no-store, must-revalidate";
add_header Pragma: "no-cache";
add_header Expires: 0;
}
location /assets {
expires 1y;
add_header Cache-Control "public";
access_log off;
}
}

View File

@@ -21,7 +21,7 @@ module.exports = (env) => ({
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].[contenthash].min.js',
filename: 'assets/[name].[contenthash].min.js',
publicPath: '/',
},
devServer: {
@@ -109,7 +109,7 @@ module.exports = (env) => ({
loader: 'worker-loader',
options: {
publicPath: '/',
name: '3rdparty/[name].[contenthash].js',
name: 'assets/3rdparty/[name].[contenthash].js',
},
},
},
@@ -120,7 +120,7 @@ module.exports = (env) => ({
loader: 'worker-loader',
options: {
publicPath: '/',
name: '[name].[contenthash].js',
name: 'assets/[name].[contenthash].js',
},
},
},
@@ -137,7 +137,7 @@ module.exports = (env) => ({
new CopyPlugin([
{
from: '../cvat-data/src/js/3rdparty/avc.wasm',
to: '3rdparty/',
to: 'assets/3rdparty/',
},
]),
],