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 ?no-cache=1 to Form submit handler #33

Merged
merged 1 commit into from
Sep 10, 2018
Merged

Add ?no-cache=1 to Form submit handler #33

merged 1 commit into from
Sep 10, 2018

Conversation

iammatthias
Copy link

With the latest version of gatsby-plugin-offline, most pages are served from the service worker so they can work offline. To prevent the service worker from handling form submissions, add ?no-cache=1 to the URL.

fetch("/contact?no-cache=1", {
  "body": encode({ 'form-name': 'contact', ...this.state })
});

See this issue for more details: gatsbyjs/gatsby#7997

With the latest version of gatsby-plugin-offline, most pages are served from the service worker so they can work offline. To prevent the service worker from handling form submissions, add ?no-cache=1 to the URL. 

```
fetch("https://iamv2.iammatthias.com/contact?no-cache=1", {
  "body": encode({ 'form-name': 'contact', ...this.state })
});
```

See this issue for more details: gatsbyjs/gatsby#7997
@ryanwiemer
Copy link
Owner

@iammatthias good catch! Thanks for the background info and PR.

@ryanwiemer ryanwiemer merged commit 3239eff into ryanwiemer:v2 Sep 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants