RateMyArea - interesting rails bits

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 1 Group

    RateMyArea - interesting rails bits - Presentation Transcript

    1. Ciarán Lee
    2. RateMyArea.com • Local-Social-Search • Starting off in Dublin • Launched 7 November • Rails app
    3. Interesting things we have done • Search • Caching • iPhone web app
    4. Search
    5. Search = sphinx • moving from ultrasphinx to thinking_sphinx • more actively developed • nice syntax • we are overhauling search
    6. geo-search • sphinx does this very well • insists on radians • ultrasphinx provides a nice interface # CREATE AN INDEX define_index do indexes :name has \"RADIANS(latitude)\", :as => :latitude, :type => :float has \"RADIANS(longitude)\", :as => :longitude, :type => :float end # RUN A SEARCH for popular bars nearby @bars = Listing.search(\"bar\", :per_page => 10, :page => 1, :geo => [deg2rad(@where.latitude), deg2rad(@where.longitude)], :order => average_rating DESC, :with => {\"@geodist\" => 0.0..2000})
    7. caching - in order of preference 1. Page caching 2. Action caching 3. Fragment caching
    8. Caching Page caching not possible if content changes for ANY user * Action caching can be used conditionally - for logged out users caches_action :show , :if => Proc.new { |controller| controller.send(:logged_out?) } * unless server side includes (SSI) are used
    9. 20,000 action cached places But... the footer is dynamic How to keep the action cache but change the footer?
    10. Server Side Includes Wikipedia: “As its name implies, its primary use is including the contents of one file into another one dynamically when the latter is served by a web server.” <!--# include virtual=\"/ssi/footer\" --> The webserver inserts the contents of the include before sending the response to the client http://blog.kovyrin.net/2007/08/05/using-nginx-ssi-and-memcache-to-make-your-web-applications-faster/ http://www.jkraemer.net/tags/nginx
    11. also... • Object caching can be handy for expensive queries • these objects can be fetched out of request/ response cycle (we use workling for this) • don’t keep page cache in RAILS_ROOT/public - this will preserve it through redeploys http://blog.hasmanythrough.com/2008/1/30/segregated-page-cache-storage
    12. RateMyArea on your mobile (if you have an iPhone) • We like MobileSafari! • iUi used for the interface • development has stalled • good starting point... • Flickr agree with copied us :) http://code.flickr.com/blog/2008/10/27/lessons-learned-while-building-an-iphone-site/
    13. RateMyArea on your mobile (if you have an iPhone) • No access to CoreLocation through the browser :( • phonegap can fix this • native iPhone app • wraps a web-app • really is a site specific browser • http://github.com/sintaxi/phonegap/tree/master
    14. Maps on the iPhone • Native app is really nice • can render kml • different firmware versions have different capabilities :(
    15. Thank You keepusbusy@ratemyarea.com

    + ciaran.leeciaran.lee, 11 months ago

    custom

    510 views, 1 favs, 0 embeds more stats

    The slides from a presentation I gave at the Ruby I more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 510
      • 510 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 5
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags

    Groups / Events