Closed dsilhavy closed 1 year ago
@dsilhavy: I understand from @davidjwbbc that the currently released implementation of the 5GMS AF sets a time-to-live value of 60 seconds for the M5 Service Access Information resource. (This is statically configurable at runtime via the msaf.serverResponseCacheControl.m5_service_access_information_response_max_age
parameter in the YAML configuration file for the 5GMS AF.) This should allow easy testing of your revalidation timer.
I believe that the response from the 5GMS AF already includes both Last-Modified
and strong ETag
headers as well as Cache-Control: max-age
, as required by clause 6.2.3.4 quoted above.
While @davidjwbbc has developed proper support for conditional HTTP GET
requests on this resource as part of 5G-MAG/rt-5gms-application-function#63, note that this code is not yet available on the development branch. There is a safe fallback position, however: if a server doesn't support conditional requests it can't return 304 Not Modified, and always returns 200 OK with the requested resource. This gives you a nice opportunity to make the reference Media Session Handler implementation more robust.
I would suggest storing the Last-Modified
and strong ETag
header values of the initial Service Access Information resource representation. When you revalidate the Service Access Information, but the 5GMS AF doesn't support conditional requests, it would be reasonable to compare the new Last-Modified
and ETag
header values of the 200 OK response with the previous ones.
Last-Modified
and ETag
are the same as before, it's a reasonable bet that the underlying Service Access Information resource hasn't changed, and you don't need to process the response body further.
Cache-Control: max-age
to schedule the next revalidation.Last-Modified
and ETag
have changed, you need to process the Service Access Information in the response body.
Last-Modified
and ETag
values for next time, of course.Cache-Control: max-age
.When we release the updated code implementing the conditional GET
requests, you will be able to test your alternative code path for the 304 Not Modified response code. The handling for this response is essentially the same as case (1) above, just more explicitly signalled.
The changes are addressed in #31 . My tests looked good, I also checked against the Linode instance. As pointed out by @rjb1000 the AF version on the Linode instance returns always 200 ok
even when the ServiceAccessInformation did not change. By comparing last-modified
and etag
headers of the previous request to the current ones we avoid updating the internal representation of the ServiceAccessInformation in this case.
Detailed change logs can be found in #31.
Released in version 1.0.2
Feature description
TS 26.512 Section 4.7.2.3 defines the detailed procedure for updating the Service Access Information:
TS 26.512 Section 6.2.3.4 defines support for conditional HTTP
GET
requests highlighting details about the responses from the 5GMS AFImplementation
Implement the logic described above in the Media Session Handler. Currently, the Service Access Information is fetched only once at playback start never updated unless the streaming session is restarted.