Is the information in http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles on caching images still the best way on how to cache images that are served from the database? I haven''t added time information to my image table yet, and the images are sent after every single page view (even if it''s been downloaded already). Joe
On Thu, 10 Mar 2005 02:45:32 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is the information in > http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles on caching > images still the best way on how to cache images that are served from > the database? > > I haven''t added time information to my image table yet, and the images > are sent after every single page view (even if it''s been downloaded > already). > > Joe >Is there a way to use Rails caching on files pulled from the DB?
On Thu, 10 Mar 2005 14:08:00 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Thu, 10 Mar 2005 02:45:32 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Is the information in > > http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles on caching > > images still the best way on how to cache images that are served from > > the database? > > > > I haven''t added time information to my image table yet, and the images > > are sent after every single page view (even if it''s been downloaded > > already). > > > > Joe > > > > Is there a way to use Rails caching on files pulled from the DB? >Anyone know?
caches_page> Is there a way to use Rails caching on files pulled from the DB?Never tried it though. Make sure you rewrite the url to contain .jpg or whatever in it ( /files/show/343/whatever.jpg should work fine ) -- Tobi http://www.snowdevil.ca - Snowboards that don''t suck http://www.hieraki.org - Open source book authoring http://blog.leetsoft.com - Technical weblog
On Sat, 12 Mar 2005 17:26:46 -0500, Tobias Luetke <tobias.luetke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> caches_page > > > Is there a way to use Rails caching on files pulled from the DB? > > Never tried it though. > > Make sure you rewrite the url to contain .jpg or whatever in it ( > /files/show/343/whatever.jpg should work fine )Why does it have to contain the file extension?
On Sun, 13 Mar 2005 14:01:33 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sat, 12 Mar 2005 17:26:46 -0500, Tobias Luetke > <tobias.luetke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > caches_page > > > > > Is there a way to use Rails caching on files pulled from the DB? > > > > Never tried it though. > > > > Make sure you rewrite the url to contain .jpg or whatever in it ( > > /files/show/343/whatever.jpg should work fine ) > > Why does it have to contain the file extension?Maybe some browsers misbehave? Have you tried sending out an expires header? HTTP provides *lots* of caching. Check out section 14.9 of the RFC. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9> _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers Koz
> On Sun, 13 Mar 2005 14:01:33 -0800, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On Sat, 12 Mar 2005 17:26:46 -0500, Tobias Luetke > > <tobias.luetke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > caches_page > > > > > > > Is there a way to use Rails caching on files pulled from the DB? > > > > > > Never tried it though. > > > > > > Make sure you rewrite the url to contain .jpg or whatever in it ( > > > /files/show/343/whatever.jpg should work fine ) > > > > Why does it have to contain the file extension? >> > since caches page dumps the file into the file system and lets apache > serve it up. Without the file extension apache will serve it up with a > default mime type like application/text which in case of images isn''t > pretty. > > If the cached "page (file)" ends in .jpg it will be served with jpg > mime which causes browsers to display the thing correctly.caches_page saves the result of the action, right? So, if the output of the action depends on what the id is, then it''s not going to work quite right?