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

Loading rewrites disables page cache #399

Closed
abovedave opened this issue May 25, 2018 · 3 comments
Closed

Loading rewrites disables page cache #399

abovedave opened this issue May 25, 2018 · 3 comments
Assignees

Comments

@abovedave
Copy link
Contributor

abovedave commented May 25, 2018

Load Web with a basic configuration:

{
  "server": {
    "host": "127.0.0.1",
    "port": 3001
  },
  "cluster": false
}

npm start and visit a route a few times, observe the request headers:

Cache-Control: public, max-age=86400
Connection: keep-alive
Content-Encoding: br
Content-Length: 461
Content-Type: text/html
Date: Fri, 25 May 2018 13:34:20 GMT
ETag: W/"1cd-16397801258"
X-Cache: HIT
X-Cache-Lookup: HIT

Then add a rewrites block to the config.json

{
  "server": {
    "host": "127.0.0.1",
    "port": 3001
  },
  "cluster": false,
  "rewrites": {
    "path": "./workspace/routes/rewrites.txt"
  }
}

Reload the app then observe page headers again:

Connection: keep-alive
Content-Encoding: br
Content-Length: 461
Content-Type: text/html
Date: Fri, 25 May 2018 13:35:56 GMT

DADI Web 6.0.0
Node.js 8.9
NPM 6.1.0

@abovedave
Copy link
Contributor Author

abovedave commented May 25, 2018

This returns undefined when rewrites is in the config:

const endpoint = this.getEndpoint(req)

@jimlambie jimlambie self-assigned this May 29, 2018
@jimlambie
Copy link
Contributor

@abovedave what is the URL being used to test the above?

@abovedave
Copy link
Contributor Author

I'm using this, but also can recreate with a blank rewrites.txt file:

\/join$ /en/#join [R=302,NC,L]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants