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

Add cache busting logic for TranslationAPI and LocaleAPI #3959

Closed
1 task
jeffchew opened this issue Sep 15, 2020 · 1 comment
Closed
1 task

Add cache busting logic for TranslationAPI and LocaleAPI #3959

jeffchew opened this issue Sep 15, 2020 · 1 comment
Assignees
Labels
dev Needs some dev work package: services Work necessary for the Carbon for IBM.com services package priority: high
Milestone

Comments

@jeffchew
Copy link
Member

User Story

As a [user role below]:
IBM.com User

I need to:
be sure I have the latest version of the IBM.com Masthead/Footer navigation information

so that I can:
always have the latest navigation data during my IBM.com browsing experience

Additional information

  • The TranslationAPI stashes the data into sessionStorage and serves up from there. Currently, there is no cache clearing policy in place, and assumes it will be refreshed when the browser is restarted.
  • A timestamp can probably be set and added to the saved object in sessionStorage, then compare that to current time
  • Decision is to expire the sessionStorage after 2 hours

Acceptance criteria

  • Adding cache clearing logic to the TranslationAPI and LocaleAPI
@jeffchew jeffchew added package: services Work necessary for the Carbon for IBM.com services package dev Needs some dev work labels Sep 15, 2020
@jeffchew jeffchew added this to the Sprint 20-20 milestone Sep 15, 2020
@IgnacioBecerra IgnacioBecerra self-assigned this Oct 14, 2020
@IgnacioBecerra
Copy link
Contributor

I'll be splitting this into two PRs, one for Translation and another for Locale.

kodiakhq bot pushed a commit that referenced this issue Oct 27, 2020
### Related Ticket(s)
#3959

### Description

Added a new `timestamp` property within the response json to compare with the current time. If the timestamp is older than two hours, a new response will be fetched with a new, current timestamp. 

Also implemented tests for the new methods.

### Changelog

**New**

- `timestamp` property added to the response json for cache busting purposes

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
kodiakhq bot pushed a commit that referenced this issue Oct 28, 2020
### Related Ticket(s)

#3959 

### Description

As done in [TranslationAPI](#4240), this PR adds a new timestamp property within the response json to compare with the current time. If the timestamp is older than two hours, a new response will be fetched with a new, current timestamp.

Also implemented tests for the new methods.

### Changelog

**New**

- `timestamp` property added to the response json for cache busting purposes

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Needs some dev work package: services Work necessary for the Carbon for IBM.com services package priority: high
Projects
None yet
Development

No branches or pull requests

3 participants