Any idea how to handle eTags at client side? We are planning to use eTags with images in our application which are coming from the server.
For what is eTag please see this: http://en.wikipedia.org/wiki/HTTP_ETag
Open the Find My app, then tap the Items tab. Choose the AirTag you want to locate, then tap Find . Follow the onscreen instructions and move around the space until your iPhone connects to your AirTag. Your iPhone displays the distance and direction to your AirTag.
Anyone who is alerted to the presence of an unknown AirTag, either through Apple's notification system or by using Tracker Detect, can trigger an audible chime to help them locate the device.
What is the distance an individual AirTag can track with Bluetooth? Apple has not specified the exact Bluetooth range of an AirTag, but it's believed that each AirTag supports Bluetooth 5.0 (same as the latest iPhones), which means it should be trackable within 800 feet.
ETag is used for efficient browser cache in order to decrease bandwidth consumption. If a website uses ETag for its web page resources, the server won't need to send a full response for every request if the resources don't change. Lastly, Etags prevents “mid-air collisions” or “simultaneous updates of resources”.
Starting points for your study ...
NSMutableURLRequest
Here you can set eTag value for you request.
[self addValue:eTag forHTTPHeaderField:@"If-None-Match"];
This request is usable with NSURLConnection.
NSURLConnectionDelegate
Delegate of your NSURLConnection has method ...
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
... where response in your case is NSHTTPURLResponse
.
You should check response statusCode in another delegate's method ...
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
... status code 304 is received when remote object is not modified. If remote object is modified and eTag is supported, you can find it in [response allHeaderFields]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With