Nash.rb Message Board › Page Caching presentation
|A former member||
Below is a link to Slideshare for a copy of the presentation "Rails Page Caching" given at the February meetup.
Thanks for the great presentation, Travis.
Travis' talk inspired a few questions with respect to a project I'm working on. Here are the findings from some testing I did after this evening's meeting.
As mentioned, I'm storing flashcard images in the database, and want to be able to cache them. It turns out that if the URL ends with a file extension, then the cached images are also saved with that extension. That is,
results in a cache file of /public/card_img/1.html, even when including a 'image/png' type in the send_data call, but
results in a cache file of /public/card_img/1.png
This means that there should be no problem using images stored in the database...they just become images the first time they are used and are recognizable by Apache, et al, as images.
On another note, expire_page can be called from within the controller. As Travis mentioned, this won't suffice for data that is coupled, but since the controller handles caching, it seems symmetrical for it to take care of expiring the cache if the data being cached are simple (as in my case, an image that can only be updated from the controller).