Nikola Smolenski smolensk@eunet.yu writes:
Wu Zhe wrote:
Asynchronous daemon doesn't make much sense if page purge occurs on server side, but what if we put off page purge to the browser? It works like this:
- mw parser send request to daemon
- daemon finds the work non-trivial, reply *immediately* with a best fit or just a place holder
- browser renders the page, finds it's not final, so sends a request to daemon directly using AJAX
- daemon reply to the browser when thumbnail is ready
- browser replace temporary best fit / place holder with new thumb using Javascript
The daemon now have to deal with two kinds of clients: mw servers and browsers.
To me this looks way too overcomplicated. I suggest a simpler approach:
- mw copies a placeholder image to the appropriate filename: the
placeholder could be the original image, best match thumb or a PNG with text "wait until the thumbnail renders"; 2. mw send request to daemon; 3. daemon copies resized image over the placeholder.
This simpler approach differs in that it gets rid of the AJAX thing, now users have to manually refresh the page. Whether the AJAX is worth the effort is discussable.