FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse

stevekrouse

compress_response

Public
Like
1
compress_response
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
main.tsx
https://stevekrouse--6273321225f111f0ad23569c3dd06744.web.val.run
README.md

Compress Response

Isn't it cool that browsers can natively decompress stuff? There are a couple of supported compression algorithms: gzip (used below), compress, deflate, br.

Learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding

If you don't add the content-encoding header, the gzip result looks like:

���������
���.���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������YDA��"��

Which is incredibly short for a 500kb string! (Which shouldn't be surprising because it's just "hi" 250k times)

Migrated from folder: Archive/compress_response

HTTP
  • main.tsx
    stevekrouse--62…44.web.val.run
Code
README.md
H
main.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.