Skip to content

Commit 28cea02

Browse files
Merge pull request #2642 from devtron-labs/feat/enable-nginx-caching
chore: enhance gzip configuration in nginx for improved performance
2 parents 2d03669 + 45c1c43 commit 28cea02

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

nginx.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ http {
1919
sendfile on;
2020
#tcp_nopush on;
2121
keepalive_timeout 65;
22+
2223
gzip on;
24+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
25+
gzip_vary on;
26+
gzip_min_length 1024;
27+
gzip_proxied any;
28+
gzip_comp_level 6;
29+
gzip_static on;
30+
2331
include /etc/nginx/conf.d/*.conf;
2432
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
"ts-jest": "29.2.5",
131131
"ts-node": "10.9.2",
132132
"typescript": "5.5.4",
133+
"vite-plugin-compression2": "^1.3.3",
133134
"vite-plugin-image-optimizer": "^1.1.8",
134135
"vite-plugin-pwa": "^0.21.1",
135136
"vite-tsconfig-paths": "5.0.1"

vite.config.mts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfil
2828
import { VitePWA } from 'vite-plugin-pwa'
2929
// import { ViteImageOptimizer } from 'vite-plugin-image-optimizer'
3030
import tsconfigPaths from 'vite-tsconfig-paths'
31+
import { compression } from 'vite-plugin-compression2'
3132

3233
const WRONG_CODE = `import { bpfrpt_proptype_WindowScroller } from "../WindowScroller.js";`
3334
const TARGET_URL = 'https://preview.devtron.ai/'
@@ -187,6 +188,9 @@ export default defineConfig(({ mode }) => {
187188
svgr({
188189
svgrOptions: {},
189190
}),
191+
compression({
192+
algorithm: 'brotliCompress',
193+
}),
190194
reactVirtualized(),
191195
requireTransform(),
192196
NodeGlobalsPolyfillPlugin({

yarn.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,6 +1933,15 @@
19331933
estree-walker "^2.0.2"
19341934
picomatch "^2.3.1"
19351935

1936+
"@rollup/pluginutils@^5.1.0":
1937+
version "5.1.4"
1938+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.1.4.tgz#bb94f1f9eaaac944da237767cdfee6c5b2262d4a"
1939+
integrity sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==
1940+
dependencies:
1941+
"@types/estree" "^1.0.0"
1942+
estree-walker "^2.0.2"
1943+
picomatch "^4.0.2"
1944+
19361945
19371946
version "4.37.0"
19381947
resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.37.0.tgz#9bedc746a97fe707154086365f269ced92ff4aa9"
@@ -8425,6 +8434,11 @@ tapable@^2.2.0:
84258434
resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz"
84268435
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
84278436

8437+
tar-mini@^0.2.0:
8438+
version "0.2.0"
8439+
resolved "https://registry.yarnpkg.com/tar-mini/-/tar-mini-0.2.0.tgz#2b2cdc215f5b83b0ab8ce363dc9ded22de51849b"
8440+
integrity sha512-+qfUHz700DWnRutdUsxRRVZ38G1Qr27OetwaMYTdg8hcPxf46U0S1Zf76dQMWRBmusOt2ZCK5kbIaiLkoGO7WQ==
8441+
84288442
temp-dir@^2.0.0:
84298443
version "2.0.0"
84308444
resolved "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz"
@@ -8945,6 +8959,14 @@ victory-vendor@^36.6.8:
89458959
d3-time "^3.0.0"
89468960
d3-timer "^3.0.1"
89478961

8962+
vite-plugin-compression2@^1.3.3:
8963+
version "1.3.3"
8964+
resolved "https://registry.yarnpkg.com/vite-plugin-compression2/-/vite-plugin-compression2-1.3.3.tgz#d33ddfb4000c914783f4760f81a44ba52fc21ed1"
8965+
integrity sha512-Mb+xi/C5b68awtF4fNwRBPtoZiyUHU3I0SaBOAGlerlR31kusq1si6qG31lsjJH8T7QNg/p3IJY2HY9O9SvsfQ==
8966+
dependencies:
8967+
"@rollup/pluginutils" "^5.1.0"
8968+
tar-mini "^0.2.0"
8969+
89488970
vite-plugin-image-optimizer@^1.1.8:
89498971
version "1.1.8"
89508972
resolved "https://registry.npmjs.org/vite-plugin-image-optimizer/-/vite-plugin-image-optimizer-1.1.8.tgz"

0 commit comments

Comments
 (0)