Hey everybody, Is it possible to detect whether dynamically generated data, such as an image or a pdf, is already cached in the client? This would be data that is *not* saved on the server''s filesystem. I suppose this would be a Javascript issue, and it might be off-topic, and I apologize if so. I just wanted to see if anyone else was doing this with Rails and where I could find an answer. Thanks in advance for any help, Greg
It is possible. Look at wiki.rubyonrails.com/rails/show/HowtoSendFiles which has an example querying the If-Modified-Since HTTP header (sent by the browser) and sending a "304 Not Modified" response header. Read up on this at: w3.org/Protocols/rfc2616/rfc2616- sec10.html, Section 10.3.5 Google for "304 not modified" for more info. Thomas Am 26.07.2005 um 21:29 schrieb Greg McClure:> Hey everybody, > > Is it possible to detect whether dynamically generated data, such as > an image or a pdf, is already cached in the client? This would be data > that is *not* saved on the server''s filesystem. I suppose this would > be a Javascript issue, and it might be off-topic, and I apologize if > so. I just wanted to see if anyone else was doing this with Rails and > where I could find an answer. > > Thanks in advance for any help, > Greg > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > lists.rubyonrails.org/mailman/listinfo/rails >
Thomas Fuchs wrote:> It is possible. > > Look at wiki.rubyonrails.com/rails/show/HowtoSendFiles which > has an example querying the If-Modified-Since HTTP header (sent by > the browser) and sending a "304 Not Modified" response header. > > Read up on this at: w3.org/Protocols/rfc2616/rfc2616- > sec10.html, Section 10.3.5 > > Google for "304 not modified" for more info. >Another good link is: fishbowl.pastiche.org/2002/10/21/http_conditional_get_for_rss_hackers What I want to know is if you do a caches_page or a caches_action to generate this file, does the server (Apache or lighttpd) automatically work correctly for the If-Modified-Since headers?> Thomas > > Am 26.07.2005 um 21:29 schrieb Greg McClure: > >> Hey everybody, >> >> Is it possible to detect whether dynamically generated data, such as >> an image or a pdf, is already cached in the client? This would be data >> that is *not* saved on the server''s filesystem. I suppose this would >> be a Javascript issue, and it might be off-topic, and I apologize if >> so. I just wanted to see if anyone else was doing this with Rails and >> where I could find an answer. >> >> Thanks in advance for any help, >> Greg >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> lists.rubyonrails.org/mailman/listinfo/rails >> > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > lists.rubyonrails.org/mailman/listinfo/rails >