Skip to main content
Inspiring
June 11, 2019
Answered

Big JSON files

  • June 11, 2019
  • 12 replies
  • 2281 views

Hi there

The json files that I have in the dr folder are making the scorm file too heavy.

I looked a bit in them to see what do they contain. I would like to understand a bit more about them and possibly to reduce the size.

I am using as many shared actions as possible and try not to be heavy with the advanced actions.

At the end of the post there is an image of the dr folder. There are quite a few that are about 1 MB.

I opened one of these json files and I can see the following on the first lines

cp.imagesJSONCache075={

"dr/btn_SHRC.png": "iVBORw0KGgoAAAANSUhEUgAAAIoAAABDCAYAAABDYJ0YAAAGVElEQVR4nO2cwZHiOhCGv/fqXXRkQ2CrnAATAhOCNwQIAUKAEIYQhhAghCUBVY1DWI4+zjuohYUsGzMMYG/1V0Uxgy1ZZf+WWt0tgaIoiqIoiqIoiqIoiqIoiqIoijJU/nl2Ay5hDStgEfy0BzZZydYacuA9UWwPbLOSjdSxAFYtl/mRlRyja+bAODhnI9c9WMME+C2/v2Qlh6jN4fF1VrJsOV4r30f+e3YD2rCGHTDFPfgDMAJmwBHYBqcecQ+S4JypNeDFkjjvhBeJPMB3nEAOwFpOGUudE+ClQ9Pz4O8ZnAtliPRWKNYwxYmkyEpeg0Pz1PnhW2sNBZx6ok3TedH1RlQi2WYlv6LjE6h6nQvM5HuPE+wsEuzg+PfZDWhh5L+tORsCurCX77EIoAsznEiKWCQAWckhKykuVSLD3AjX43lxzJpLDIM+C2WPe4NHwIc17MR26MJEvo+h7XGBaXDdW/DDzjYr2QIFMJEeabD0VijygF/hZOhNgYU1fIoRm8QaZlTGb9zdj6S8//wJj8l3V2Glrj3FibQQkUBlSw26V+mtjQKuuwde5G3MqWYib5wbsyNr+IyKbxL2SGzMHhN/dx2qUngxhG3b4oSbW8Pyih6uV/RaKB4RzMEa1sAHThhhVx4KoGgzHJuMWcTwpBqCrkJsIV92IbZKiJ+NrRkgvRWK3PhF9GBH8jmKP+Nk5LYIoCsb3Js/toZVwveRQ6tBO5O2HajbOWNcb6hCuQMrYCY2h+8h/Bv75ZudMoi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oI2nfVP6uMirjcG48OXh+6GmlpfhF3A9sElbXDDv28MHfWQwQqESSaco7QPwqZfTZ+SwPpohCeXm/UuuIE6griV0wynyvadaI/3XMiQb5Tv2L+lKbMy2Gay/cDOs1TcZ0r1kSELxD25856RpuMLYDHZB2Mnnr2QwQ49MQ704ar4JWS/TuGXXPZG2zXHG7bUbEw6CIfUo4Lr5d5wBmcw/saa2f8lX9h+Z2vpukoe2WVXg6PsrbZVBCUXyT14a8k/8ztKxH+Ur+4+ktuhaQ/v0W/Z0mXDFcgxFURRFURRFURRFURRFURRFURRFuTf/A8BkoV3VhCQnAAAAAElFTkSuQmCC",

1. The cp.imagesJSONCache075 refers to what exactly? The other files have a different number.

2. The btn_SHRC is the object name of a smart shape button with a colour fill. There is no png involved there.

Why would that be reported in the json file with a png as an extension? The smart shapes are converted to pngs maybe?

3. Overall, how can one reduce the size of the project?

Thanks in advance

B

    This topic has been closed for replies.
    Correct answer RodWard

    Actually there IS an image file with that button, because in normal (non-responsive) HTML5 output the buttons and Smart shapes would be turned into PNG images.  The PNGs are then being turned into JSON files. That's what you are seeing.

    The JSON files are used in HTML5 output to reduce the number of image files that need to be downloaded from the server.  That code you see in the JSON file is describing one or more PNG files in what is known as Base64 encoding. It's usually done for PNG files, not JPGs.

    The 'serialised' encoded data of the image is actually slightly larger than image itself but the advantage of this method is that you can have multiple small images encapsulated in a single JSON file. The reason this is desirable is that instead of making multiple requests to the server to get each individual image file you can just get one file that does them all.  In the case of an e-learning course with lots of small PNG files the performance of the course can be greatly improved by using JSON files.

    If you want to reduce the number of JSON files, you need to look at ways of reducing the number of objects.  How many buttons do you have in this project?

    12 replies

    RodWard
    Community Expert
    RodWardCommunity ExpertCorrect answer
    Community Expert
    June 11, 2019

    Actually there IS an image file with that button, because in normal (non-responsive) HTML5 output the buttons and Smart shapes would be turned into PNG images.  The PNGs are then being turned into JSON files. That's what you are seeing.

    The JSON files are used in HTML5 output to reduce the number of image files that need to be downloaded from the server.  That code you see in the JSON file is describing one or more PNG files in what is known as Base64 encoding. It's usually done for PNG files, not JPGs.

    The 'serialised' encoded data of the image is actually slightly larger than image itself but the advantage of this method is that you can have multiple small images encapsulated in a single JSON file. The reason this is desirable is that instead of making multiple requests to the server to get each individual image file you can just get one file that does them all.  In the case of an e-learning course with lots of small PNG files the performance of the course can be greatly improved by using JSON files.

    If you want to reduce the number of JSON files, you need to look at ways of reducing the number of objects.  How many buttons do you have in this project?

    Inspiring
    June 12, 2019

    Hi there Rod,

    Thank you for that reply. I understand the process a bit better now.

    I guess using JPEGS is not very smart since it would slow down the

    To answer your question, I have quite a few buttons and shapes. Would be hundreds. Is there a way to calculate that automatically?

    Also, what about responsive output. Would there be a json file and would the size be smaller normally? I do not use responsive normally, but would consider it if the size is reduced.

    On a side note, I have read different opinions, but would be good to hear yours. Are any unused items in the project really make the output scorm file bigger?

    Thanks again

    B

    Lilybiri
    Legend
    June 12, 2019

    Will not answer about JSON.

    However clearing the library of unused  items is NOT reducing the output file sze. This is not an 'opinion' but I asked that question to the team over 10 years ago, anc my 'intuition' was fully confirmed. I know that some 'experts' claim the contrary, but it is easy to test this out (as I did).

    I will rarely clear the library, since sometimes the Usage button fails (careful with assets used in states).