Issue 12638

Starting a new download should be a POST

12638
Reporter: mdoering
Assignee: fmendez
Type: Improvement
Summary: Starting a new download should be a POST
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2013-01-24 14:33:44.344
Updated: 2013-09-26 15:11:18.083
Resolved: 2013-09-26 15:11:18.05
        
Description: A simple GET as we have now is easily executed several times via multiple button clicks, browsers history or a refresh.
We should use a POST here]]>
    


Author: mdoering@gbif.org
Created: 2013-02-26 11:39:59.922
Updated: 2013-02-26 11:39:59.922
        
This is more difficult than it first appears. The download link is generated by a javascript widget which is also used for the normal search links. It does not use any form, but modifies the browsers url. To make it work with a POST we need to modify all search pages and create a form instead and then adjust the widget to dynamically create hidden form inputs.

Alternatively we might want to live with a GET and make sure we cache results so that accidently reissued downloads will not impact our infrastructure badly cause it will be served by the first issued download.
    


Author: trobertson@gbif.org
Created: 2013-02-26 11:51:29.926
Updated: 2013-02-26 11:51:29.926
        
You want to use the Post/Redirect/Get [1] pattern, but using a GET instead of a Post

[1] http://en.wikipedia.org/wiki/Post/Redirect/Get

After the initial GET which triggers the download, redirect to the downloads list page with whatever is needed to notify the user that the download is running.  Resubmissions would just reload the download page, and going back would require the user to specifically trigger the download again (which seems reasonable behavior to allow).  
    


Author: mdoering@gbif.org
Comment: The redirection only solves the page refresh problem. The download link can still be copied & bookmarked, visited in the browsers history or via the back button. To prevend that we still need a POST or even better intelligent caching?
Created: 2013-02-26 15:53:06.644
Updated: 2013-02-26 15:53:06.644


Author: fmendez@gbif.org
Created: 2013-09-26 15:11:18.081
Updated: 2013-09-26 15:11:18.081
        
Downloads started using a POST, the download/result shows the result and status of a download request
http://code.google.com/p/gbif-portal/source/detail?r=2273