[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

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.

User1234

8/12/2015 7:31:00 PM

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?
2 Answers

JJ

8/13/2015 4:28:00 PM

0

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.

Thomas 'PointedEars' Lahn

8/14/2015 6:51:00 AM

0

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: <http://www.mnot.net/cache...

--
PointedEars
FAQ: <http://PointedEars.... | SVN: <http://PointedEars.de...
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-...
Please do not cc me. / Bitte keine Kopien per E-Mail.