New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save as 'JSON minified' #944

Open
Deathspike opened this Issue May 12, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@Deathspike

Deathspike commented May 12, 2015

When saving a tiled map as JSON, the JSON file is written with quite a bit of spacing between elements. The spacing serves no real purpose and increases the file size of the tiled map. This is important when working a web related project, any increased file size decreases user experience due to a higher download time.

Please consider either:

  • Saving files as JSON as minified by default
  • Or, allowing a different file extension (.jsonm?) that is always minified after editing.
  • Allowing a preference in the tiled map editor that switches on minification

@bjorn bjorn added the feature label May 12, 2015

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn May 12, 2015

Owner

I'll consider this feature, but note that serving the file compressed will have a much bigger impact on reducing the download time than removing the whitespace. To avoid increasing CPU usage, it is also possible to precompress the server-side file. Compression is supported by the HTTP standard so should be transparent to the client.

Related to this is adding support for saving the tile layer data as binary compressed rather than as a JSON array, in the same way as is already done in the TMX format. This is covered by issue #343.

Owner

bjorn commented May 12, 2015

I'll consider this feature, but note that serving the file compressed will have a much bigger impact on reducing the download time than removing the whitespace. To avoid increasing CPU usage, it is also possible to precompress the server-side file. Compression is supported by the HTTP standard so should be transparent to the client.

Related to this is adding support for saving the tile layer data as binary compressed rather than as a JSON array, in the same way as is already done in the TMX format. This is covered by issue #343.

@Deathspike

This comment has been minimized.

Show comment
Hide comment
@Deathspike

Deathspike May 12, 2015

You are absolutely correct. However, most modern web servers are quite capable of compressing and caching the result by themselves (when configured appropriately). I'm just a bit on the absolute optimization side, and I even currently have a pipeline that copies and minifies the JSON files, but I'd love to get rid of that complexity.

Deathspike commented May 12, 2015

You are absolutely correct. However, most modern web servers are quite capable of compressing and caching the result by themselves (when configured appropriately). I'm just a bit on the absolute optimization side, and I even currently have a pipeline that copies and minifies the JSON files, but I'd love to get rid of that complexity.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jul 13, 2015

Owner

You may be interested to know that I just implemented #343.

Owner

bjorn commented Jul 13, 2015

You may be interested to know that I just implemented #343.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn
Owner

bjorn commented Dec 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment