score:3
When the browser call reaches the server it must have the gzip
encoding enabled: the request header must contain something like:
Accept-Encoding: gzip, deflate, br
All browsers support this but older browsers may not have it.
You don't have to add any extra script
tags to get this to work. You reference the js
file.
You are serving your files with a node http server that doesn't know what to do with gzip
files unless accessed directly.
When getting a request that can handle gzip
, the server should check if the requested file also has an archived version of it and serve that instead.
I haven't tested this implementation but it seems to be doing what you need: you have to adjust your node server.
When serving files with nginx
or Apache
, enabling gzip
is a setting.
Hope it helps
Source: stackoverflow.com
Related Query
- compression webpack bundle using plugin
- Bundle error using webpack for Electron application `Cannot resolve module 'electron'`
- Enable text compression using React, Webpack and Apache
- Does the use of es6 named imports reduce the bundle size when using webpack
- Plugin system for apps compiled using Webpack
- Bundle react app created with npx create-react-app to .js file using Webpack
- Using terser webpack plugin how to avoid building with comments
- Trying to remove 'react-hot-loader' from final bundle using webpack ignorePlugin
- Why does App state resets when using Webpack HMR plugin with Redux- DevTools?
- How to exclude mobx and mobx-react from the bundle using webpack
- Require multiple files dynamically using webpack bundle loader
- How should I access hash bundle file name in index.ejs using webpack DefinePlugin
- Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema
- Dynamically import images from a directory using webpack
- Using webpack aliases in mocha tests
- Get Webpack not to bundle files
- Webpack optimize with UglifyJS plugin causes runtime error
- Writing embeddable Javascript plugin with React & Webpack
- TypeError: Cannot read property 'javascript' of undefined + terser webpack plugin + react js
- How to update webpack config for a react project created using create-react-app?
- Using autoprefixer with postcss in webpack 2.x
- Using the Webpack dev server with a PHP application
- Using React Router with CDN and without webpack or browserify
- Using Webpack with React-router bundle.js Not Found
- Upload File using ReactJS via BlueImp FileUpload jQuery plugin
- import CSS and JS files using Webpack
- 'window is not defined' error when using style-loader with webpack
- Using React Router and Webpack 2 how to require external libraries only on certain routes?
- What is the pros and cons of using Rails asset pipeline vs. webpack to hold assets?
- Why webpack includes elliptic bn.js modules in my bundle
More Query from same tag
- How to conditionally pass optional props to component when we use React with Typescript?
- React document upload with plupload
- Dispatching an action from a Redux container without extending React.Component
- Complete solution
- How to fetch api when mounting of React.js
- Using useState and setting a class accordingly in React
- Add invalid parameters dynamically to Joi validation
- ReactJs throwing error importing svg files
- TypeScript, undefined value to concrete
- is there a way of passing the cars component as the search result from the search inputs in React.js?
- npx-create-react-app my-app command ERROR in Vs Code
- React listen to child's state from parent
- react select with border radius scroll is overflowing
- Webpack React build throwing errors on html tags
- why is react select default value not working
- How to choose between class methods and properties in react?
- React: Changing prop type value for nested component on page level
- Input field validation and displayed conditions
- React: How does one access a phone's actual camera app (not load feed in browser)?
- What's the redux-react way to manipulate props in react children component
- Accessing previous theme variables in createMuiTheme
- Can't pass request body through next-http-proxy-middleware
- How to add event to react function and re-render function
- React - File Uploader
- React JS, can't write nested array inside prop to console
- Intermittent problem using loginPopup MSAL JS in a REACT
- javascript elseif case in JSX
- Using mySQL with React : Questions and CORS problem
- Getting an error message while trying to execute Router Component in ReactJS using Jest and Enzyme
- Mutating state from React's useState hook