If you're building a web app with ruby on rails, there's a pretty good chance you're using the will_paginate gem to make it easy to split a long list of items across multiple pages. If you have a couple hundred items, will_paginate works great out of the box. However, once you start paginating thousands and thousands of items, you'll start to run into performance issues. I'll show you how to fix them in this post.
I learned this lesson the hard way, so you should learn from my mistakes. Don't put big fields like TEXTs or BLOBs in your main database tables. Doing so will result in a negative step change in the performance of your database one day when you least expect it. You'll think your database is humming along when suddenly your database queries that used to finish in a couple milliseconds start taking hundreds of seconds.
I recently ran into a problem with the Facebook share button on my blogging platform, Bloopist. Whenever I shared an post, the share box from Facebook showed an incorrect image and description of the post. This led me to ask the question, "How can I force Facebook to rescrape or update a URL or Open Graph object?"
I recently started using React in my web apps to make them more interactive. React is great for the view layer of an application, but it needs to be paired with a backend of some sort. In my web apps, I use Ruby on Rails to generate a JSON API that is consumed by my React views. In getting started with React and Ruby on Rails, I learned a few things. I'd like to share those with you today.