Skip to content
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

Closed
Deathspike opened this issue May 12, 2015 · 4 comments
Labels
Projects
Milestone

Comments

@Deathspike
Copy link

@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.

Copy link
Owner

@bjorn 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.

Copy link
Author

@Deathspike 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.

Copy link
Owner

@bjorn bjorn commented Jul 13, 2015

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

@bjorn

This comment has been minimized.

Copy link
Owner

@bjorn bjorn commented Dec 20, 2017

@bjorn bjorn added this to Tiled 1.3 (next feature release) in Roadmap Feb 21, 2019
@bjorn bjorn closed this in 58a50e4 Jul 26, 2019
Roadmap automation moved this from Tiled 1.3 (next feature release) to Recently Completed Jul 26, 2019
@bjorn bjorn added this to the Tiled 1.3 milestone Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Roadmap
  
Recently Completed
2 participants
You can’t perform that action at this time.