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

Invalidate output cache using POST #2084

Merged
merged 4 commits into from
Dec 14, 2018
Merged

Invalidate output cache using POST #2084

merged 4 commits into from
Dec 14, 2018

Conversation

Cyclonecode
Copy link
Collaborator

Related issues

#2083

Short description and why it's useful

As described in the feature request, clearing the output cache should be supported by using either POST or GET requests. Since both GET and POST request now clears the cache in the same way it might be better to move the clear cache thing into a separate function?

Screenshots of visual changes before/after (if there are any)

(if you made any changes in the UI layer please provide before/after screenshots)

Screenshot of passed e2e tests (if you are using our standard setup as a backend)

(run yarn test:e2e and paste the results. If you are not using our standard backend setup or demo.vuestorefront.io you can ommit this step)

Upgrade Notes and Changelog

  • No upgrade steps required (100% backward compatibility)
  • I've updated the Upgrade notes and Changelog on how to port existing VS sites with this new feature

Contribution and currently important rules acceptance

Copy link
Collaborator

@pkarw pkarw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply the DRY principle and extract the request handler for cache invalidation as a function to be called in the .post and .get handlers you can also use .all handler for all request method however we probably need to support just get and post in here

@Cyclonecode
Copy link
Collaborator Author

@pkarw - Yes I also thought this would be nice. Wrote a comment about this in the PR =) I will fix this today.

app.post('/invalidate', (req, res) => {
invalidateCache(req, res)
})

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be a little bit nicer:
app.post(‘/invalidate’, invalidateCache)
app.get(‘/invalidate’, invslidsteCache)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I actually did this already but forgot to push =) I will do this now.

@pkarw pkarw merged commit 95cd775 into vuestorefront:develop Dec 14, 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.

None yet

2 participants