Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Conversation

@lmorchard
Copy link
Contributor

  • In server.js, cache responses to the GET request handler
  • In caching.js, ResponseCache wraps around a response handler, which
    caches the results and honors HTTP conditional GET and cache control
    semantics

Copy link
Contributor

Choose a reason for hiding this comment

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

should all these var's go up higher? I know variable hoisting will take care of it, but I was confused by the cache_key reference in 64 before I noticed this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh, no those should go higher, good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though, oddly enough, the behavior here ends up being correct: Since cache_key is null at the time revalidate() gets called, the response from unsupported request methods doesn't get cached.

But, that's just an accident, and this needs to be coded better. I'll probably commit some tweaks to fix

@groovecoder
Copy link
Contributor

r+ after the nits - code looks good and makes sense, tests pass, works locally.

* In server.js, cache responses to the GET request handler

* In caching.js, ResponseCache wraps around a response handler, which
  caches the results and honors HTTP conditional GET and cache control
  semantics
lmorchard added a commit that referenced this pull request Mar 16, 2012
bug 730714: Implement response caching
@lmorchard lmorchard merged commit 6557240 into mdn:master Mar 16, 2012
escattone pushed a commit that referenced this pull request Jun 23, 2017
use done for test changed from sync to async
jwhitlock pushed a commit that referenced this pull request Feb 5, 2018
update regarding master
escattone pushed a commit that referenced this pull request Jul 18, 2019
Sync with MDN repo changes
escattone pushed a commit that referenced this pull request Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants