5G-MAG / rt-5gms-media-session-handler

5G Media Streaming - Media Session Handler
https://www.5g-mag.com/streaming
Other
4 stars 4 forks source link

Updating the Service Access Information - Support for the expires header #51

Closed dsilhavy closed 5 months ago

dsilhavy commented 7 months ago

Description

TS 26.512 Section 4.7.2.3 defines the procedure for polling the Service Access Information. The polling periodicity is defined as follows:

The periodicity of polling for updated Service Access Information shall be guided by the value of the Expires and/or Cache-control: max-age headers that shall be included along with every response message for this procedure.

We currently support Cache-control: max-age headers but lack support for the expires header. The difference between both is defined as follows:

Expires headers and the max-age directive both control the caching of resources. But there’s a significant difference: while Expires headers specify an absolute expiration date/time, max-age is relative to the time of the request.

The goal of this issue is to add support for the expires header and integrate the logic into the startServiceAccessInformationUpdateTimer method in the MediaSessionHandlerMessengerService.

In case both max-age and expires are present the values shall be translated to absolute times, compared and the earlier value shall be used.

If an age header is present, that value shall be subtracted from the value defined in max-age.

shilinding commented 7 months ago

@dsilhavy @rjb1000 I've added the support of Expires header. Implemented as below:

But I still have three concerns:

  1. The Cache-Control header is always with the max-age or s-maxage directive in the response, is the case that there is only s-maxage but no max-age exist? If yes, do we need to support it? Is the case of Cache-Control header exist, but no max-age? If yes, use Expires header?
  2. Is the the case that neither Cache-control nor Expires header exist, do we need to support this case?
  3. If in Cache-Control header the max-age = 0, the MSH will keep polling the Service Access Information one after another. Do we think this is the behavior we expect?

Thanks.

dsilhavy commented 7 months ago
  1. s-maxage is for shared caches (proxies) and it is also not used in 26.512. No need to support s-maxage. Ignore the cache-control header in this case and use the expires header.
  2. That violates the specification. In case none of the headers are defined, we use a static configurable refresh value like 10 minutes.
  3. Keep this behavior as we are expecting the server wants us to do an immediate refresh. We are expecting a different value of max-age with the next response.
dsilhavy commented 5 months ago

Addressed in #55