All threads / Fragment Caching And oEmbed Discussion
Ask A Question


You’re not receiving notifications from this thread.

Fragment Caching And oEmbed Discussion

Really great episode, I will be implementing something similar soon. While watching I had a question: Could the first-time-slow-page be avoided by making a rake task to visit all video pages using something like httparty, watir, mechanize, or something similar? We have a little over 200 videos on our site, so this would be nice to avoid the delay every day/week/whatever we set the cache length.

You could remove the expires_in option and set up a nightly cron job to expire the fragments and then immediately request the page instead. When you do it with an expiration like this, you can't know when it expires exactly so it would be hard to expire and then request the page again.

Even better, syncing those two, expiration and cache, was bothering me. Thanks Chris!

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,099+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.