Changes between Version 3 and Version 4 of howto/AvoidRedirects


Ignore:
Timestamp:
Aug 6, 2013, 9:43:50 PM (11 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

fix title; rewrite introduction; add introduction to sourceforge section about why managing redirects there is extra important; add pointer to branch variable

Legend:

Unmodified
Added
Removed
Modified
  • howto/AvoidRedirects

    v3 v4  
    11[wiki:howto <- Back to the HOWTO section]
    22
    3 = How to build Avoid master_sites Redirects  =
     3= How to avoid master_sites redirects  =
    44
    55 * Audience: Portfile authors
     
    88== Introduction ==
    99
    10 In order to be a good 'Net citizen, it is worthwhile to minimize the load on other's servers.  One simple technique is to specify the `master_sites` parameter as specifically as possible so that the other side does not have to supply redirects in order to serve the file we want.  This how-to currently addresses only SourceForge.
     10`master_sites` should usually be specified in such a way that HTTP redirects are avoided.
     11This not only reduces network traffic and server load but also lets the user start their download more quickly.
     12This how-to currently addresses only SourceForge but similar techniques can be used for any other site.
    1113
    1214== SourceForge ==
     15
     16In addition to the aforementioned general reasons for avoiding redirects, it's especially important for files hosted at SourceForge.
     17For all ports, MacPorts tries to download from a server near to the user (measured by ping time).
     18SourceForge has a network of mirror servers, of which MacPorts maintains [browser:trunk/dports/_resources/port1.0/fetch/mirror_sites.tcl a list].
     19But if the server MacPorts has chosen to use issues a redirect, it might redirect to a different server which might have a worse ping time, which we want to avoid.
    1320
    1421Hopefully, the following example, using mediainfo version 0.7.60, will illuminate the process.  The SourceForge home page for mediainfo is [[http://mediainfo.sourceforge.net]].  Initially, just specifying  `'sourceforge'` in the portfile under development worked to retrieve the distfile. 
     
    3845}}}
    3946
     47In the event that the URL had included "0.7" (and not "0.7.60") you would want to define and employ [PortfileRecipes#branch the ${branch} variable] instead of ${version}.
     48
    4049Pat yourself on the back--you're done!
    4150