Skip to content

Commit b842df9

Browse files
committed
revert this later: enable compression for all requests
1 parent 7444286 commit b842df9

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

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.0;
2828

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

0 commit comments

Comments
 (0)