I’m working on a site in Drupal which will reside at http://sub.clientdomain.com, pulling in an static html fragment from a server on at http://clientdomain.com/path/to/fragment.html, which I need to display in a page, to give a parent menu for a site.
I’m working on a VPS, so I have access to curl, wget and pretty much anything I want to install.
What’s the optimal way to do this?
Your first approach sounds like a good idea. By using a cronjob, the pulling of the content is separated from your site, so the user doesn’t have to wait.
If you have access to the page that generates the fragment, you could reduce net traffic by actively sending the new content instead of requesting it every couple of minutes.
I’d store the fragment in a database, though, as I believe database-queries are faster than access to the filesystem.