I am writing a web application that pulls small parts of articles from Wikipedia and presents them to users.
I do not wish to delete entries of the articles because I do not want to be sending a ridiculous amount of requests to the WikiMedia API, putting unnecessary load on them.
My question is, since Wikipedia is by nature, collaborative and dynamic, what would be the best way to serve reasonably updated content to users (the content does not have to reflect the current article 100%, but it shouldn't be too far behind) without constantly querying their servers?
I'm leaning towards storing the snippets of the articles in my database along with a timestamp and whenever an user requests an article with a timestamp over x days, I would re-query the API and update the entry in my database.
User queries article -> my server returns article -> client-side checking decides the timestamp is too old -> client-side re-queries WikiMedia and displays the content to the user -> client-side fires request to my server to store the data.
This seems like it could be done better, but I do not want to be querying WikiMedia directly from my server...
How could I make this better?
Architecture: SlimPHP framework, RethinkDB + PHP driver, jQuery/JS, HTML, CSS