...
There's a lot of structural redundancy in the average json file, making it a very good candidate for compression (you can expect more than 95 % reduction in size).
How can I monitor file tranfer duration ?
Google Chrome comes with a built-in troubleshooting tool (known as Developer Tools) that allows one to monitor the time taken to fetch files from the server to the client (the browser) :
- Press Ctrl + Shift + I to show / hide it.
- Make sure the Network tab is active / selected
- Use the clear button to clear the network log and make sure the "Disable Cache" property is ticked
- Refresh the page
- Locate the semRootEO file and check its size and transfer duration
- Select the file to see the current Content Type : it should be application/json
Step-by-step guide
- Open the server.xml file with your favorite text editor (it's typically found in the tomcat_root/conf folder)
- Locate the <Connector> element
Modify it by adding three compression-related properties as follows
Code Block compression="on" compressionMinSize="4096" compressableMimeType="text/html,application/json"
- Restart your tomcat server
- Start developer tools in chrome, go to network tab, select the semRootEO file, and check the header to make sure the changes were applied : the content encoding should now be *gzip*
Info | ||
---|---|---|
| ||
This is not a solution to all performance issues, and could be detrimental if you compress files that don't need to be compressed : watch your tresholds and don't compress javascript and image files |
...