Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: http services in operating systems  (Read 2676 times)

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
http services in operating systems
« on: August 13, 2022, 02:12:04 AM »

In operating systems such as iOS, when an application calls a routine to perform an http(s) operation, does the application get the benefit of some web caching that’s managed by the o/s ? (The alternative being that web browsers might have to write content caching logic themselves as a layer over the http protocol io operations.)

This would mean that one web browser would or would not get the benefit of seeing the cache entries stored by another browser. Or not.

The reason I ask is that I’m seeing some occasional really weird behaviour in a Shortcuts program that calls http services. Sometimes it seems to come up with bogus results that do seem as if they might be coming from bogus data. The bogus results are not utter garbage, so this leads my thoughts in a certain particular direction. When I immediately run the program a second time, the bogus results go away, so I asked myself if it is possible that the results are simply old, and could I be seeing a caching effect ? Hence the speculation about caching in the o/s. I need to get rid of the caching effect to fix this, setting the cache lifetime to zero somehow.
Logged

Alex Atkin UK

  • Addicted Kitizen
  • *****
  • Posts: 5260
    • Thinkbroadband Quality Monitors
Re: http services in operating systems
« Reply #1 on: August 13, 2022, 03:32:28 AM »

I believe the answer is no, you create a cache object(s) for your app specifically.  I'm not sure, with them mentioning "shared" cache.
https://developer.apple.com/documentation/foundation/url_loading_system/accessing_cached_data
Logged
Broadband: Zen Full Fibre 900 + Three 5G Routers: pfSense (Intel N100) + Huawei CPE Pro 2 H122-373 WiFi: Zyxel NWA210AX
Switches: Netgear MS510TXUP, Netgear MS510TXPP, Netgear GS110EMX My Broadband History & Ping Monitors

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: http services in operating systems
« Reply #2 on: August 13, 2022, 09:03:14 AM »

I’m glad about that. But it doesn’t help me with my weird bug. Maybe a Shortcuts bug or something wrong in the webserver settings.
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: http services in operating systems
« Reply #3 on: August 13, 2022, 08:33:19 PM »

A way round it perhaps would be no-cache and 0 ttl headers on the server side, one would expect a http client to honour it.
Logged

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: http services in operating systems
« Reply #4 on: August 13, 2022, 09:26:22 PM »

Ah, of course, I remember now; I need to tell the client, the browser, to behave itself. I’ve used the relevant cache-control fields before, many years ago. I think I need to talk to our friend Mr Johnson about it and see what he says.

I need some help in working out whether it really is a caching effect that I’m seeing and not some other buggy thing, but I can’t see how it can be a fault in my code, as I run the program, see the badness, then run the program again, and second time of execution all is well. And my code has no persistent storage in it; no file io, for example. Do you agree with my logic in this argument ? Alternatively, it could be some very weird bug in Shortcuts itself, so actually I might just ignore it until iOS 16 comes out, just in case there is a relevant known Shortcuts bug that gets fixed, and then I won’t have wasted anyone’s time debugging.
Logged

Chrysalis

  • Content Team
  • Addicted Kitizen
  • *
  • Posts: 7382
  • VM Gig1 - AAISP L2TP
Re: http services in operating systems
« Reply #5 on: August 14, 2022, 08:51:04 PM »

I dont know, normally my means of debugging is to hit the f12 key to use dev mode in the browser, this then tells me the headers, and how the client behaves, or perhaps to use a diagnostic tool.

But you are debugging a LAN based http service using code written on top of ios shortcuts?  So these kind of means of diagnosing are not available to you. 
Logged