Well this is kind of a question of how to design a website which uses less resources than normal websites. Mobile optimized as well.
Here it goes: I was about to display a specific overview of e.g. 5 posts (from e.g. a blog). Then if I'd click for example on the first post, I'd load this post in a new window. But instead of connecting to the Database again and getting this specific post with the specific id, I'd just look up that post (in PHP) in my array of 5 posts, that I've created earlier, when I fetched the website for the first time.
Would it save data to download? Because PHP works server-side as well, so that's why I'm not sure.
Ok, I'll explain again:
Method 1:
- User connects to my website
- 5 Posts become displayed & saved to an array (with all its data)
- User clicks on the first Post and expects more Information about this post.
- My program looks up the post in my array and displays it.
Method 2:
- User connects to my website
- 5 Posts become displayed
- User clicks on the first Post and expects more Information about this post.
- My program connects to MySQL again and fetches the post from the server.