I'm currently working on a site that uses a PHP function to get JSON data and display it on the page. However, when loading the page, it freezes until it has successfully gotten the response, which looks strange because it hasn't loaded the closing html tags yet.
I could make an ajax call with Javascript which would happen asynchronously after page load, but as the pages are static I am caching them with PHP so this way the response wouldn't be cached.
Is there either a way to make the PHP JSON call happen after page load with PHP or could I cache the javascript JSON response?
REQUESTa different web-resource, which sends back a JSON response, which you're then sending through to the client who visited your page? Why not separate the page's PHP from the JSONREQUEST, and have the client do a second async request when their page has loaded?