Jump to content

Remove redundant info in nations API


Kid Winchell
 Share

Recommended Posts

Since the nations API page serves info for every nation in the game, it's a pretty large file. Since it's in the interest of everyone for things to be as small and fast as possible, redundant things should be removed. Particularly, the url tag provides no new information (it's just a static string plus nationid, which is already given), and removing it reduces filesize by 15%. Latitude and longitude serve no functional purpose other than determining your continent, which, again, is already given. And if people want it, they can grab it from an individual nation's API page, along with other flavour stats, like their leader's title. Removing latitude and longitude reduces filesize by 10%. There are minor things, like serving the nation's rank as an integer instead of a string reduces filesize by half a percent. Indenting with two spaces instead of four reduces filesize by 15%. Or, since properly-formatted, readable JSON doesn't seem to be that big of a concern, what with the random indentations all willy-nilly, you could just serve it as compact JSON, reducing filesize by 38%.

 

tl;dr Compared to the current filesize, removing redundant info reduces filesize by 25%, trimming spaces reduces filesize by 15%, and serving compact JSON reduces filesize by 38%. Removing redundant info and trimming spaces reduces filesize by 39%, while removing redundant info and serving compace JSON reduces filesize by an impressive 57%.

  • Upvote 1
RollSheepy.png

Link to comment
Share on other sites

  • Administrators

I've reduced the size of the nations API page by 58%. That's even 1% more than you calculated ;)

  • Upvote 3

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.