My application get JSON data from server. If I use my own json api , data is loaded only in internet connection. But if I use this api (https://pixabay.com/api/?key=5303976-fd6581ad4ac165d1b75cc15b3&q=kitten&image_type=photo&pretty=true), data is displayed also in offline, once application got internet connection.
The same code, one json url is loaded also after the loss of internet connectivity, another one's data doesn't display after internet disconnection. How to store data in android cache from server-side as this URL (https://pixabay.com/api/?key=5303976-fd6581ad4ac165d1b75cc15b3&q=kitten&image_type=photo&pretty=true).
My api (api1.php)
<?php
require("includes/connect.php");
header('Content-Type: application/json');
$query="SELECT * FROM implink";
$result = $con->query('SELECT id,heading,content FROM implink');
$rows = $result->fetchAll(PDO::FETCH_ASSOC);
header('Content-Type: application/json;charset=utf-8');
echo json_encode(['info' => $rows],
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK);
?>