SlideShare uma empresa Scribd logo
1 de 17
Ciarán Lee
RateMyArea.com

•   Local-Social-Search
•   Starting off in Dublin
•   Launched 7 November
•   Rails app
Interesting things we have done


• Search
• Caching
• iPhone web app
Search
Search = sphinx

• moving from ultrasphinx to thinking_sphinx
  • more actively developed
  • nice syntax
  • we are overhauling search
geo-search
• sphinx does this very well
• insists on radians
• ultrasphinx provides a nice interface
   # CREATE AN INDEX
   define_index do
    indexes :name
    has quot;RADIANS(latitude)quot;, :as => :latitude, :type => :float
    has quot;RADIANS(longitude)quot;, :as => :longitude, :type => :float
   end

   # RUN A SEARCH for popular bars nearby
   @bars = Listing.search(quot;barquot;,
        :per_page => 10,
        :page => 1,
        :geo => [deg2rad(@where.latitude), deg2rad(@where.longitude)],
        :order => average_rating DESC,
        :with => {quot;@geodistquot; => 0.0..2000})
caching - in order of preference


1. Page caching
2. Action caching
3. Fragment caching
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
20,000 action cached places
   But... the footer is dynamic




   How to keep the action cache but
   change the footer?
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=quot;/ssi/footerquot; -->

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
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
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/
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
Maps on the iPhone
•    Native app is really nice
    • can render kml
    • different firmware versions have different
      capabilities :(
Thank You
keepusbusy@ratemyarea.com

Mais conteúdo relacionado

Mais procurados

Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumberBachue Zhou
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2Rory Gianni
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & BackboneAshan Fernando
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6Rory Gianni
 
Programming Ruby On Rails
Programming Ruby On RailsProgramming Ruby On Rails
Programming Ruby On RailsEiji Sakai
 
AJAX Solr JS filters in Drupal
AJAX Solr JS filters in DrupalAJAX Solr JS filters in Drupal
AJAX Solr JS filters in DrupalAndrew Zahura
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)Beau Lebens
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,HowAbhishek Kumar
 
Project development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii DashkevychProject development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii DashkevychRuby Meditation
 

Mais procurados (10)

Introduce cucumber
Introduce cucumberIntroduce cucumber
Introduce cucumber
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
 
SPA using Rails & Backbone
SPA using Rails & BackboneSPA using Rails & Backbone
SPA using Rails & Backbone
 
RoR 101: Session 6
RoR 101: Session 6RoR 101: Session 6
RoR 101: Session 6
 
Programming Ruby On Rails
Programming Ruby On RailsProgramming Ruby On Rails
Programming Ruby On Rails
 
AJAX Solr JS filters in Drupal
AJAX Solr JS filters in DrupalAJAX Solr JS filters in Drupal
AJAX Solr JS filters in Drupal
 
Workshop 21: React Router
Workshop 21: React RouterWorkshop 21: React Router
Workshop 21: React Router
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
 
Project development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii DashkevychProject development - preparing hell dish together – Oleksii Dashkevych
Project development - preparing hell dish together – Oleksii Dashkevych
 

Destaque (8)

Oss Implementation OSCC MAMPU
Oss Implementation OSCC MAMPUOss Implementation OSCC MAMPU
Oss Implementation OSCC MAMPU
 
B2 b crm and supply chain connection
B2 b crm and supply chain connectionB2 b crm and supply chain connection
B2 b crm and supply chain connection
 
Unamigo
UnamigoUnamigo
Unamigo
 
La Publicidad
La PublicidadLa Publicidad
La Publicidad
 
Informe Bandas y Bandidos
Informe Bandas y BandidosInforme Bandas y Bandidos
Informe Bandas y Bandidos
 
D Ay 1
D Ay 1D Ay 1
D Ay 1
 
Neuro diseases newest
Neuro diseases newestNeuro diseases newest
Neuro diseases newest
 
Podcamp Nashville
Podcamp NashvillePodcamp Nashville
Podcamp Nashville
 

Semelhante a RateMyArea - interesting rails bits

3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.agup2009
 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Esri Nederland
 
Creating Rajanikant Powered Site
Creating Rajanikant Powered SiteCreating Rajanikant Powered Site
Creating Rajanikant Powered Sitemarkandey
 
Intro To Django
Intro To DjangoIntro To Django
Intro To DjangoUdi Bauman
 
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!Marko Gorički
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesSimon Willison
 
Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt versionrudy_stricklan
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers dssprakash
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowshwetank
 
Building WebApp with HTML5
Building WebApp with HTML5Building WebApp with HTML5
Building WebApp with HTML5Tien Tran Le Duy
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...RIA RUI Society
 
Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9ednilsoncampos
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5Ron Reiter
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignDave Olsen
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyFabio Akita
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)Bramus Van Damme
 

Semelhante a RateMyArea - interesting rails bits (20)

3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.3 Approaches to Mobile - An A to Z Primer.
3 Approaches to Mobile - An A to Z Primer.
 
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
Building mobile apps with the ArcGIS api for Javascript, Esri, Andy Gup and A...
 
Creating Rajanikant Powered Site
Creating Rajanikant Powered SiteCreating Rajanikant Powered Site
Creating Rajanikant Powered Site
 
Mobile native-hacks
Mobile native-hacksMobile native-hacks
Mobile native-hacks
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
Web enabling your survey business ppt version
Web enabling your survey business ppt versionWeb enabling your survey business ppt version
Web enabling your survey business ppt version
 
phonegap with angular js for freshers
phonegap with angular js for freshers    phonegap with angular js for freshers
phonegap with angular js for freshers
 
Building great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to knowBuilding great mobile apps: Somethings you might want to know
Building great mobile apps: Somethings you might want to know
 
Building WebApp with HTML5
Building WebApp with HTML5Building WebApp with HTML5
Building WebApp with HTML5
 
Html5 and beyond the next generation of mobile web applications - Touch Tou...
Html5 and beyond   the next generation of mobile web applications - Touch Tou...Html5 and beyond   the next generation of mobile web applications - Touch Tou...
Html5 and beyond the next generation of mobile web applications - Touch Tou...
 
Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9Primefaces mobile users_guide_0_9
Primefaces mobile users_guide_0_9
 
Multi screen HTML5
Multi screen HTML5Multi screen HTML5
Multi screen HTML5
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
RESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web DesignRESS: An Evolution of Responsive Web Design
RESS: An Evolution of Responsive Web Design
 
Always on! ... or not?
Always on! ... or not?Always on! ... or not?
Always on! ... or not?
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 

Último

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Último (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

RateMyArea - interesting rails bits

  • 2.
  • 3. RateMyArea.com • Local-Social-Search • Starting off in Dublin • Launched 7 November • Rails app
  • 4. Interesting things we have done • Search • Caching • iPhone web app
  • 6. Search = sphinx • moving from ultrasphinx to thinking_sphinx • more actively developed • nice syntax • we are overhauling search
  • 7. geo-search • sphinx does this very well • insists on radians • ultrasphinx provides a nice interface # CREATE AN INDEX define_index do indexes :name has quot;RADIANS(latitude)quot;, :as => :latitude, :type => :float has quot;RADIANS(longitude)quot;, :as => :longitude, :type => :float end # RUN A SEARCH for popular bars nearby @bars = Listing.search(quot;barquot;, :per_page => 10, :page => 1, :geo => [deg2rad(@where.latitude), deg2rad(@where.longitude)], :order => average_rating DESC, :with => {quot;@geodistquot; => 0.0..2000})
  • 8. caching - in order of preference 1. Page caching 2. Action caching 3. Fragment caching
  • 9. 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
  • 10. 20,000 action cached places But... the footer is dynamic How to keep the action cache but change the footer?
  • 11. 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=quot;/ssi/footerquot; --> 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
  • 12. 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
  • 13. 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/
  • 14. 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
  • 15. Maps on the iPhone • Native app is really nice • can render kml • different firmware versions have different capabilities :(
  • 16.