rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
541 stars 97 forks source link

Page reload takes forever #95

Closed jtreitz closed 11 years ago

jtreitz commented 11 years ago

Hey guys,

this might not be the best bug report ever but this thing keeps driving me nuts. I use sinatra-assetpack 0.2.1 and my configuration looks like this:

configure do
  assets {
    cache_dynamic_assets true

    serve '/javascripts', from: '/javascripts'
    js :application, [
      '/javascripts/lib/underscore.js',
      '/javascripts/models/*.js',
      '/javascripts/collections/*.js',
      '/javascripts/views/*.js',
      '/javascripts/application.js'
    ]
    serve '/stylesheets', from: '/stylesheets'
    css :application, [
      '/stylesheets/reset.css',
      '/stylesheets/index.css'
    ]
    serve '/images', from: '/images'
  }
end

Every page reload takes up to 25 seconds since all the assets are reloaded every damn time. I was under the impression that _cache_dynamicassets wants to fix this but it did not for me.

Am I missing something?

Thanks! JT

j15e commented 11 years ago

That's slow! Never got this kind of issue, could you see if its specific to JS or CSS assets OR the page rendering itself?

Ex. try getting /css/application.css VS /js/application.js, VS /

j15e commented 11 years ago

And could you specify which css/js preprocessor you are using if any (sass, less, coffescript, etc)..

jtreitz commented 11 years ago

oh, the reason is tmp/always_restart.txt keeps restarting for every asset loaded which sums up to 15 x 2secs. Looks like my sinatra workflow needs an update. Currently i'm using Pow and said always_restart.txt so I dont have to restart the server when I made changes. Do you have any recommendations?