Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Old ActionMailer templates being cached?

We're running a Rails 3.0.7 app with Passenger standalone + nginx and with ruby 1.9.2-p290, and we're seeing the strangest thing happen: After deploying some updates to a mailer template, new mails coming from the app sometimes have the updates applied, and sometimes the old template is being used.

I can't find anything about cached ActiomMailer templates online, and running rake tmp:cache:clear does not address the issue either, fwiw.

Has anyone ever experienced such a thing? Is there a definitive solution for this problem?

thanks,

Jacob

like image 467
trisignia Avatar asked Nov 03 '11 16:11

trisignia


People also ask

What are view caches?

View caching in Ruby on Rails is taking the HTML that a view generates and storing it for later.

Where is Rails cache stored?

Rails (as of 2.1) provides different stores for the cached data created by action and fragment caches. Page caches are always stored on disk. Rails 2.1 and above provide ActiveSupport::Cache::Store which can be used to cache strings.

What is caching in Ruby?

Caching means to store content generated during the request-response cycle and to reuse it when responding to similar requests. Caching is often the most effective way to boost an application's performance.


1 Answers

I've run into similar situations in our application, and we use Resque.

If I'm changing anything regarding mailers (which the Resque workers handle), I need to restart the workers.

Kill the workers and respawn them, it sounds like some of them might have the old environment loaded and others do not.

like image 132
Tass Avatar answered Sep 29 '22 21:09

Tass