Over a million developers have joined DZone.

Stop Google Web Accelerator In Your Rails Apps

·
class ApplicationController < ActionController::Base
  before_filter :disable_link_prefetching

  private
    def disable_link_prefetching
      if request.env["HTTP_X_MOZ"] == "prefetch" 
        logger.debug "prefetch detected: sending 403 Forbidden" 
        render_nothing "403 Forbidden" 
        return false
      end
    end
end

Code by David Heinemeier Hansson.
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}