crosswalk-project/crosswalk-website — pull request #56 by townxelliot (2014-01-30 10:53:54+00:00)
Title: Better HTTP client for wiki fetches and caching

This is a fairly big patch to incorporate better HTTP request handling into the site.

It uses cURL instead of fopen to make HTTP requests, which means it no longer has to shell out to the php binary (which previously worked around security issues with the PHP install). It falls back to fopen or shelling out to php if cURL is not available, to prevent accidental breakage on the live server.

It also provides a 5 minute cache for wiki pages. This is a slightly arbitrary number, but at least means that a user going backwards and forwards between a few wiki pages has a smoother experience.

The regen.php script should now remove any stale pages from the cache automatically, though I'm not sure this is being correctly invoked by the github wiki hooks. Once we're happy that the hook is firing correctly, and clearing the cache correctly, we could make the cache time longer (or indefinite).

I have tested it on staging, but it has not been deployed to live yet.

Fixes:

* https://crosswalk-project.org/jira/browse/XWALK-717
* https://crosswalk-project.org/jira/browse/XWALK-706