The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2009-02-12 15:31:45

ralph
Member
Registered: 2005-11-21
Posts: 55
Expertise

Passenger aka mod_rails delivering cached content for edit-route

Hi community,

I've just switched an application running on a Joyent Accelerator from Mongrels to Passenger. Everything seemed to run smoothly, but the client just called that he cannot edit some content. I've traced the problem down to page caching. As soon as a page has been cached, the edit-route will display that page instead of the edit form. Example:

GET /pages/1-my-page
=> page will be cached under public/pages/1-my-page.html

2nd GET /pages/1-my-page
=> cached page will be delivered (good!)

GET /pages/1-my-page/edit
=> cached page will be delivered (bad!), should be the edit action

GET /pages/2-uncached-page/edit
=> edit action is shown (good!)

On my local OS X machine (Leopard) I'm running mod_rails aka Passenger, too. But Passenger on OS X does not show this weird behavior, even when running in production environment with page caching enabled. So the error must be down in some apache configuration file. I've already tried some stuff, but until now without luck. Does anyone of you have a hint?
--
Greetings
Ralph

Offline

 

#2 2009-02-13 10:23:49

lderezinski
Happy Camper
From: Essex, Maryland USA
Registered: 2006-04-14
Posts: 4312
Website  Expertise

Re: Passenger aka mod_rails delivering cached content for edit-route

are you running the same versions of ruby, native gems, etc?


The greatest oak was once a little nut who held its ground.
MG->3ML->Premiere (Lithographer) + Accelerati + Joyeur (Yes, I work here, we are hiring)

Offline

 

#3 2009-02-15 03:29:15

unglued
Member
From: philly
Registered: 2005-10-18
Posts: 222
Website  Expertise

Re: Passenger aka mod_rails delivering cached content for edit-route

I was having extremely weird behavior with passenger and page caching, too. I had urls like:

http://vote.reinventinggap.org/entry/1
http://vote.reinventinggap.org/entry/2

and what happened was, one of the pages got cached (eg, /entry/15.html), and then subsequent requests for pages like "/entry/7" would strip off the id and look for a bare /entry/ (i think... or was it /entry/.html?), and then, of course, fail. Damndest thing.

No answers here, sorry, just verifying that it's not just you, that passenger does unfortunate things with URLs when faced with already-cached pages. This is on a recent (2.1.something, 2008Q2 accelerator).

I suppose we should submit a ticket? Unfortunately seems like a hard issue to pinpoint. I worked around the problem myself (having a separate page-cache directory, with some mod_rewrite rules), so it'd be hard for me to reproduce the issue again.

Offline

 

#4 2009-04-09 16:36:30

koudelka
New member
Registered: 2009-04-09
Posts: 1
Expertise

Re: Passenger aka mod_rails delivering cached content for edit-route

Hi guys,
I was having the same problem, as with ralph's experience, it was working fine on my local os x box too. I went poking around in my production apache config and found that I had turned on:

Options MultiViews

I removed that option and all of my page caching stuff started to behave.

It seems that MultiViews is responsible for negotiating the format of the returned results, in my case my controller was getting a '.html' tacked on the end.

Hope this helps,
Mike

Offline

 

#5 2009-06-12 22:03:41

bradhodges
New member
Registered: 2008-12-29
Posts: 17
Expertise

Re: Passenger aka mod_rails delivering cached content for edit-route

I'm having the same/similar problems, where to I get at the Options MultiViews.

I've found the Virtual Server Options, looks like a Windows Control Panel, is MultiViews in there some where?

I've looked but there are so many options in some I just seem to be missing it.

Help!

My particular problem is that a particular partial seems to get cached and never refreshed when my partial template changes in production.

This partial in particular is the in controller/view directory. accessed simply as :partial => 'form'.

My development WebBrick on Windows works, but production on kober does not, I always get feed up the very first version of the template. The file in production is updated, but I'm just not getting it returned to my app.

I'm on rails 2.3, frozen into my app.

I noticed when I upgraded to rails 2.3 my development environment began to suck big time due to what appeared to be caching issues. It sucked because I totally lost my fast change/test cycle. Any change at all in my development code would take 30 seconds to get served up by my test Webbrick.

Now with this I'm starting to think I've missed something real obvious in my upgrade (from 2.0.2 to 2.3). I see a lot of new caching stuff went into 2.3, I think I've tripped over it in some way.

Anybody have a guess where to start?

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson