Skip to content

Commit

Permalink
chore: add caching comment and update READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewis84 committed Feb 15, 2024
1 parent a5004dc commit e2ceefc
Showing 3 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions micro-service/README.md
Original file line number Diff line number Diff line change
@@ -66,6 +66,18 @@ For the 'FeatureFeed' embed, which displays the church's content, add `data-type

_⚠️ Make sure to replace [INSERT_CHURCH_SLUG_HERE] with your church's unique identifier, or 'slug'._

### Disabling Caching for Local Testing

For local development and testing purposes, you might want to disable caching to ensure you're receiving the latest responses directly from the API. To do this, please refer to the Apollo client configuration file:

[../packages/web-shared/client/apollosApiLink.js](../packages/web-shared/client/apollosApiLink.js)

In this file, locate the header configuration within the `apollosApiLink` function and uncomment the following line:

```javascript
// 'x-cache-me-not': 1,


### Options

| data-type |
2 changes: 2 additions & 0 deletions packages/web-shared/client/apollosApiLink.js
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ const apollosApiLink = (church_slug) =>
headers: {
...headers,
'x-church': church_slug,
// Uncomment the following line to disable caching
// 'x-cache-me-not': 1,
},
}));

13 changes: 13 additions & 0 deletions web-embeds/README.md
Original file line number Diff line number Diff line change
@@ -76,6 +76,18 @@ For the 'FeatureFeed' embed, which displays the church's content, add `data-type

_⚠️ Make sure to replace [INSERT_CHURCH_SLUG_HERE] with your church's unique identifier, or 'slug'._

### Disabling Caching for Local Testing

For local development and testing purposes, you might want to disable caching to ensure you're receiving the latest responses directly from the API. To do this, please refer to the Apollo client configuration file:

[../packages/web-shared/client/apollosApiLink.js](../packages/web-shared/client/apollosApiLink.js)

In this file, locate the header configuration within the `apollosApiLink` function and uncomment the following line:

```javascript
// 'x-cache-me-not': 1,
```

### Options

| data-type |
@@ -118,3 +130,4 @@ _⚠️ Make sure to replace [INSERT_CHURCH_SLUG_HERE] with your church's unique
| ymca_gc |

---
```

0 comments on commit e2ceefc

Please sign in to comment.