Path: csiph.com!au2pb.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: How to handle client side caching with jquery? My jquery service http request headers always carrying Cache-Control:no-cache Pragma:no-cache though i haven't added anything. Date: Fri, 14 Aug 2015 08:50:52 +0200 Organization: PointedEars Software (PES) Lines: 29 Message-ID: <4216765.rDoQC2oqx9@PointedEars.de> References: <1svdevoki2rxh$.15cme10r96mrb.dlg@40tude.net> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1439535264 6110 eJwNy8EBwCAIA8CVFAjIOAJm/xHa+x/Ut3eYww0EG5pspp2ocZ2qBxdOgmZcem7MfbVl1n9GPi+5EZ4= (14 Aug 2015 06:54:24 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Fri, 14 Aug 2015 06:54:24 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwFwQcBwEAIBDBLbIocxp9/CU1cg2PTwsMcjthXYZvC5QcbV22ZyTdMYyU9RaA6ru9aevWByY8SIJj2D1irFeI= Cancel-Lock: sha1:kff8NGb3l67vKftyD+CVzQf3R7M= X-NNTP-Posting-Host: eJwFwYEBACAEBMCV0vMYR8X+I3RnoPC60qg2NmG5dush1vbnNwLsqvFBvBQKmrsTQ85B8QMK2hC6 Xref: csiph.com comp.lang.javascript:28528 JJ wrote: > On Wed, 12 Aug 2015 12:30:53 -0700 (PDT), User1234 wrote: >> I want to do client side caching for my service response. My jquery >> service http request headers always carrying Cache-Control:no-cache >> Pragma:no-cache though i haven't added anything. How this get appened in >> my service request http headers? > > POSTed requests shouldn't be cacheable. > HTTPS requests shouldn't be cacheable. > Requests with query string (e.g.: abc.com/?query=what) shouldn't be > cacheable. > > If you do, or expect it to be, you'll break something. The answer misses the point of the question, and ends in gibberish. The “Cache-Control: no-cache” HTTP header field would be appended to the HTTP response by the entity that sent the response, the HTTP/Web server. Under which conditions it is appended – perhaps based on request header fields – can only be told by the person who set up the HTTP/Web server. See also: -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.