javascript - Best practice: multiple CoffeeScript files on a page -
i'm developing page on rails app displays analytics data. has make several calls flurry analytics api retrieve different events. i'm displaying each piece of data in div header , paragraph (which contains number retrieved analytics , inserted via jquery).
is practice me have separate coffeescript file each of these divs (8 far) calls api calculates value , displays it, or inefficient?
additional information: api i'm calling has rate limit of 1 request per second.
usually it's better keep javascript code (or coffeescript matter) in separate files convenient development, when deploying on production server compile them in 1 file.
a browser have make 1 request fetch javascript instead of making multiple requests (note modern browsers allow 2-4 concurrent requests per hostname).
this should lower page loading time.
Comments
Post a Comment