juliocesar / rack-pagespeed

Page optimizations done at the Rack level
http://rack-pagespeed.heroku.com
244 stars 22 forks source link

Rendering empty view when used in a sinatra application #8

Closed benschwarz closed 13 years ago

benschwarz commented 13 years ago

my config.ru:

require 'rubygems'
require 'bundler'
Bundler.setup

require ::File.dirname(__FILE__) + '/app'
require 'rack/pagespeed'

use Rack::ContentLength   # Set Content-Length on string bodies
use Rack::ETag            # Set E-Tags on string bodies
use Rack::ConditionalGet  # If-Modified-Since
use Rack::Deflater        # Compress HTML using deflate / gzip
use Rack::Head            # Head requests must return an empty body

case ENV['RACK_ENV']
  when "development"
    cache_store = :disk
  when "production"
    memcached_server = ENV['MEMCACHE_USERNAME'] + ":" + ENV['MEMCACHE_PASSWORD'] + "@" + ENV['MEMCACHE_SERVERS'].join
    cache_store = {memcached: memcached_server}
end

use Rack::PageSpeed, public: "public" do
  store cache_store

  inline_javascripts max_size: 4000
  inline_css
  combine_javascripts
end

run Sinatra::Application

damn html messed up the issue, I gist'd it instead:

https://gist.github.com/7b0b226a8569d2676b5a

juliocesar commented 13 years ago

You may have noticed, but the contents of the codes above aren't showing.

As I understand it you're getting empty views on a Sinatra app. I've set up a test app to try and replicate the problem, but I couldn't. Mind having a look?

Tested on Ruby 1.9.2-p0, Sinatra latest, rack-pagespeed 1.0.2, Rack latest.

juliocesar commented 13 years ago

Weird! I'm definitely getting the view as expected in here. If you send over versions for stuffs, I'll look into it more carefully.

juliocesar commented 13 years ago

Closing as the issue could not be replicated, and as per previous conversations, seems related to one particular version of Ruby (?).