Skip to content

Commit e3b0a76

Browse files
committed
enable gzip on all smoke tests
1 parent 4c0f383 commit e3b0a76

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

.github/workflows/smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: AWS RUM Web Client Smoke Tests
22

33
on:
44
push:
5-
branches: [main, release/*.*.*]
5+
branches: [main, release/*.*.*, dev/gzip]
66
workflow_call:
77
workflow_dispatch:
88

smoke/smoke-test-application-CDN/smoke.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
},
4242
useBeacon: false,
4343
releaseId: '2.1.7',
44-
legacySPASupport: true
44+
legacySPASupport: true,
45+
compressionStrategy: { enabled: true }
4546
});
4647
</script>
4748

smoke/smoke-test-application-NPM-CJS/src/loader-npm-rum.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ try {
2222
'content-type': 'application/json'
2323
},
2424
useBeacon: false,
25-
legacySPASupport: true
25+
legacySPASupport: true,
26+
compressionStrategy: { enabled: true }
2627
};
2728

2829
const APPLICATION_ID: string = $MONITOR_ID;

smoke/smoke-test-application-NPM-ES/src/loader-npm-rum.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ try {
2323
},
2424
useBeacon: false,
2525
releaseId: '2.1.7',
26-
legacySPASupport: true
26+
legacySPASupport: true,
27+
compressionStrategy: { enabled: true }
2728
};
2829

2930
const APPLICATION_ID: string = $MONITOR_ID;

src/dispatch/compression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import { InternalLogger } from '../utils/InternalLogger';
1818
// Only compress payloads larger than 2KB - smaller payloads have minimal absolute savings
1919
// and gzip header overhead (~20 bytes) becomes proportionally significant
2020
// At 2KB threshold: compresses payloads with ~10+ RUM events
21-
const MIN_SIZE_BYTES = 2048;
21+
const MIN_SIZE_BYTES = 0;
2222

2323
// Require at least 20% size reduction to use compressed output
2424
// This threshold ensures compression is worthwhile after accounting for:
2525
// - CPU cost of decompression on the server
2626
// - Risk of compressed size being larger for incompressible data
27-
const MIN_COMPRESSION_RATIO = 0.2;
27+
const MIN_COMPRESSION_RATIO = 0;
2828

2929
export type CompressionResult = {
3030
body: string | Uint8Array;

0 commit comments

Comments
 (0)