How to cache or reuse large JSON data fetched from a server
<p>I have asked a similar question few days back.</p>

<p><a href="http://stackoverflow.com/questions/16735533/avoid-getting-data-from-the-server-if-the-same-page-is-loaded-for-the-2nd-time">Avoid getting data from the server if the same page is loaded for the 2nd time</a></p>

<p>Couldn't get a clear or satisfactory solution.</p>

<p><strong>I tried few things and ended up doing this:</strong></p>

<p>Every description page gets large JSON data (~2k characters) by calling a URL.</p>

<p>So, I created a database using sqlite with fields as:</p>

<p>|  URL  |  DATA  |  TimeStamp  |</p>

<p>where the JSON data is stored as a String in the DATA field.</p>

<p>And in my application when a page is being loaded, it checks if any URL matches and gets the JSON data.</p>

<p>May be I must take care of deleting the rows whose timestamps are 1-2 days old.</p>

<p>But is this a good way of reusing server data. Any better way?</p>

<p>Also, I have 6 types of URLs, hence better to go with 6 tables and store not more than 20 rows at an instance.</p>

<p>Which in worst case contains 120 rows of large string data. Might drastically increase the app size at run time?</p>

<p>Thank You</p>
