Hi guys, I''m with a problem here, on my application, the user can define his own URI. Like user UserA can create an uri like www.myapp.com/UserA UserB can create an uri like www.myapp.com/MyNiceUri To catch this uri, i''m using this at the end of my routes.rb map.connect ''*path'' , :controller => ''project'' , :action => ''show'' On this controller, I''m also using page cache caches_page :show, :if => :project_exists Well, so far, so good. But heres the problem. If some user access the uri www.myapp.com/MyNiceUri rails will cache the MyNiceUri.html on /public Is some other user access www.myapp.com/MYNICEURI rails will cache MYNICEURIL.html on /public and do on... Well, this sucks, since to sweep this cache, i have to try a lot of upper/lower case combination to make sure theres no cache file left on filesystem. So, theres a way to solve this issue? I''m using passenger, maybe i should try any configuration on apache? Any tips will help. Regards, -- Rafael --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Jan 27, 2009 at 1:35 PM, Rafael Mueller <mueller182-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi guys, > > I''m with a problem here, on my application, the user can define his own > URI. > Like user UserA can create an uri like www.myapp.com/UserA > UserB can create an uri like www.myapp.com/MyNiceUri > > To catch this uri, i''m using this at the end of my routes.rb > > map.connect ''*path'' , :controller => ''project'' , :action => ''show'' > > On this controller, I''m also using page cache > caches_page :show, :if => :project_exists > > Well, so far, so good. But heres the problem. > > If some user access the uri www.myapp.com/MyNiceUri rails will cache the > MyNiceUri.html on /public > Is some other user access www.myapp.com/MYNICEURI rails will cache > MYNICEURIL.html on /public and do on... > > Well, this sucks, since to sweep this cache, i have to try a lot of > upper/lower case combination to make sure > theres no cache file left on filesystem. > > So, theres a way to solve this issue? > I''m using passenger, maybe i should try any configuration on apache? > > Any tips will help. > > Regards, > -- > Rafael > > > >Why don''t you store the uri in lowercase in the database and then translate the name to lowercase before looking it up. Then operate all your caching etc in lowercase. -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
How can I do this? :cache_path doesnt seems to work with page caching. Regards On Tue, Jan 27, 2009 at 9:42 AM, Andrew Timberlake < andrew-642hCh26+Dt3UeSHeRwt+FaTQe2KTcn/@public.gmane.org> wrote:> On Tue, Jan 27, 2009 at 1:35 PM, Rafael Mueller <mueller182-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> Hi guys, >> >> I''m with a problem here, on my application, the user can define his own >> URI. >> Like user UserA can create an uri like www.myapp.com/UserA >> UserB can create an uri like www.myapp.com/MyNiceUri >> >> To catch this uri, i''m using this at the end of my routes.rb >> >> map.connect ''*path'' , :controller => ''project'' , :action => ''show'' >> >> On this controller, I''m also using page cache >> caches_page :show, :if => :project_exists >> >> Well, so far, so good. But heres the problem. >> >> If some user access the uri www.myapp.com/MyNiceUri rails will cache the >> MyNiceUri.html on /public >> Is some other user access www.myapp.com/MYNICEURI rails will cache >> MYNICEURIL.html on /public and do on... >> >> Well, this sucks, since to sweep this cache, i have to try a lot of >> upper/lower case combination to make sure >> theres no cache file left on filesystem. >> >> So, theres a way to solve this issue? >> I''m using passenger, maybe i should try any configuration on apache? >> >> Any tips will help. >> >> Regards, >> -- >> Rafael >> >> >> > Why don''t you store the uri in lowercase in the database and then translate > the name to lowercase before looking it up. > Then operate all your caching etc in lowercase. > > -- > Andrew Timberlake > http://ramblingsonrails.com > http://www.linkedin.com/in/andrewtimberlake > > "I have never let my schooling interfere with my education" - Mark Twain > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Jan 27, 2009 at 1:46 PM, Rafael Mueller <mueller182-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> How can I do this? > :cache_path doesnt seems to work with page caching. > > Regards > > On Tue, Jan 27, 2009 at 9:42 AM, Andrew Timberlake < > andrew-642hCh26+Dt3UeSHeRwt+FaTQe2KTcn/@public.gmane.org> wrote: > >> On Tue, Jan 27, 2009 at 1:35 PM, Rafael Mueller <mueller182-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >> >>> Hi guys, >>> >>> I''m with a problem here, on my application, the user can define his own >>> URI. >>> Like user UserA can create an uri like www.myapp.com/UserA >>> UserB can create an uri like www.myapp.com/MyNiceUri >>> >>> To catch this uri, i''m using this at the end of my routes.rb >>> >>> map.connect ''*path'' , :controller => ''project'' , :action => ''show'' >>> >>> On this controller, I''m also using page cache >>> caches_page :show, :if => :project_exists >>> >>> Well, so far, so good. But heres the problem. >>> >>> If some user access the uri www.myapp.com/MyNiceUri rails will cache the >>> MyNiceUri.html on /public >>> Is some other user access www.myapp.com/MYNICEURI rails will cache >>> MYNICEURIL.html on /public and do on... >>> >>> Well, this sucks, since to sweep this cache, i have to try a lot of >>> upper/lower case combination to make sure >>> theres no cache file left on filesystem. >>> >>> So, theres a way to solve this issue? >>> I''m using passenger, maybe i should try any configuration on apache? >>> >>> Any tips will help. >>> >>> Regards, >>> -- >>> Rafael >>> >>> >>> >> Why don''t you store the uri in lowercase in the database and then >> translate the name to lowercase before looking it up. >> Then operate all your caching etc in lowercase. >> >> -- >> Andrew Timberlake >> http://ramblingsonrails.com >> http://www.linkedin.com/in/andrewtimberlake >> >> "I have never let my schooling interfere with my education" - Mark Twain >> >> >> > > > >You could configure Apache to look for files in the cache directory with no regard for case. You could also check the uri against your lowercase version and if they don''t match, send a 301 redirect to the lowercase uri. Then you''re only ever caching the lowercase version and any other case gets correctly redirected to the cached version. If you do this from early on in your project, you shouldn''t have any mixed case issues because all links etc will go to the lowercase pages. -- Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---