I’m supposed to make queries from MySql database once a day and display data on the page… and this sounds like cron job – I never did this before and I’d like you opinion.
if I make query once a day, I have to save this data in a file, let’s say, xml file and every time the page reloads, it has to parse data from that file.
From my point of view, it would be faster and more user friendly to make query every time the page loads, as data would be refreshed …
Any help please ….
Thank for your answers, I’ll update my answer … I don’t think the queries would be extensive: something like find the most popular categories from articles, the most popular cites from where the author is … three of those queries. So data pulled out from database will rely only on two tables, max three and only one will have dynamic data, other will be small ones.
I didn’t ask yet why … because it is not available at the moment …
It all depends on the load on the server. If users are requesting this data a few times a day, then pulling the data on each request should be ok (KISS first). However, if they are slamming the server many times and the request is slow on top of that, then you should store the data off. I would just suggest storing it to a table and just clearing the table each night on a successful reload.