Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds functionality to re-request the Service Access Information #31

Merged
merged 2 commits into from Aug 3, 2023

Conversation

dsilhavy
Copy link
Contributor

@dsilhavy dsilhavy commented Aug 2, 2023

  • Adds a new ClientSessionModel class to save all information about a running streaming session. We use a hashmap to map a client id to an instance of this new model class
  • Parses the headers from the ServiceAccessInformation response of the AF (M5)
  • Starts a timer that re-requests the ServiceAccessInformation based on max-age in the cache-control header
  • Compares the current values of the etag and the last-modified headers to the previous ones. If nothing changed the ServiceAccessInformation is not updated and the timer is reset according to max-age
  • Sends previous etag and last-modified header values as If-None-Match and If-Modified-Since request headers.

This needs more testing once our Linode instance is back. For the implementation I did a quick check with a local server:

Response headers:

res.set({
        'ETag': '12345',
        'last-modified': Date.now(),
        'cache-control': 'max-age=10, test=20'
})

Request headers:

{if-none-match: "12345", if-modified-since: "1690985040545"}

This addresses #30

… on the max-age header. Moreover, sends previous "etag" and "last-modified" header values as "If-None-Match" and "If-Modified-Since" request headers.
@dsilhavy dsilhavy self-assigned this Aug 3, 2023
@dsilhavy dsilhavy merged commit da953ae into development Aug 3, 2023
1 check passed
@dsilhavy dsilhavy deleted the feature/updateServiceAccessInformation branch August 16, 2023 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant