Prior to 3.1/pipeline, adding a maintenance page was as simple as dropping a file in place on the server, and a apache rewrite rule. Now... all my assets are dynamic. So the files that are referenced by my static maintenance.html file change, and break. Has anyone come across a nice solution for presenting a maintenance page during deploy? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If you use Rails 3.1.1, it will by default add non-digested assets in addition to the digest ones. So in static pages, you can just refer to the non-digest asset filenames, and they should be consistent. -GR On Nov 2, 2011, at 8:35 AM, Josh Sharpe wrote:> Prior to 3.1/pipeline, adding a maintenance page was as simple as > dropping a file in place on the server, and a apache rewrite rule. > > Now... all my assets are dynamic. So the files that are referenced by > my static maintenance.html file change, and break. > > Has anyone come across a nice solution for presenting a maintenance > page during deploy? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Vandenabeele
2011-Nov-02 16:37 UTC
Re: maintenance page with 3.1 and assets pipeline
On Wed, Nov 2, 2011 at 5:17 PM, Greg Reinacker <gr2020-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you use Rails 3.1.1, it will by default add non-digested assets in > addition to the digest ones. So in static pages, you can just refer to the > non-digest asset filenames, and they should be consistent. >I currently have this snippet in my Apache sites-available file to enable Far future expiration: ExpiresActive on <FilesMatch "\.(js|css|gif|png|jpg)$"> ExpiresDefault "access plus 1 week" SetOutputFilter Deflate </FilesMatch> When using these non-digest asset filenames, I believe there is a risk the cache could be "frozen" on old versions. Should the non-digest asset filenames not be marked in a special way or stored in a special directory to make it easier to exclude them from far future expiration? Or is there an easy way to improve my configuration to only do far future expiration on digested asset filenames? Thanks, Peter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well, and this is off the top of my head and totally untested, you could change your apache config to something like <LocationMatch "^/assets/.*-[0-9a-f]{32}.*$"> ... </LocationMatch> That should just match files in the assets directory that have a 32-character digest, and not match un-digested files... -GR On Nov 2, 2011, at 10:37 AM, Peter Vandenabeele wrote:> On Wed, Nov 2, 2011 at 5:17 PM, Greg Reinacker <gr2020-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > If you use Rails 3.1.1, it will by default add non-digested assets in addition to the digest ones. So in static pages, you can just refer to the non-digest asset filenames, and they should be consistent. > > I currently have this snippet in my Apache sites-available file to enable > Far future expiration: > > ExpiresActive on > <FilesMatch "\.(js|css|gif|png|jpg)$"> > ExpiresDefault "access plus 1 week" > SetOutputFilter Deflate > </FilesMatch> > > When using these non-digest asset filenames, I believe there is a risk the cache > could be "frozen" on old versions. > > Should the non-digest asset filenames not be marked in a special way or stored in a > special directory to make it easier to exclude them from far future expiration? > > Or is there an easy way to improve my configuration to only do far future expiration > on digested asset filenames? > > Thanks, > > Peter > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.