You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(2) The above function call only has 2 parameters, the middle one is missing. It should be a boolean, that determines whether or not to set the max-age value. Instead the second parameter is an object, which converts to True, so service-worker.js gets a max-age value when it shouldn't.
(Modern browsers might ignore this, but it's still better to have a zero value. It can also be overwritten by the web server, such as Nginx, but it should be correct by default)
(3) The third parameter, "options" is also missing , so the Content-Type doesn't get set. Furthermore, setHeaders must be a function, not an object. As described in the docs: https://expressjs.com/en/api.html#setHeaders
Expected behavior
The static file default cache (maxAge) is 1 month (or other value?)
service-worker.js has zero max-age
Content-Type is set to "text/javascript" for service-worker.js
Steps to reproduce the issue
Open a browser tab/window with Developer Tools open on the Network tab
Select the service-worker.js file and note the following item in the Response Headers:
"cache-control: public, max-age=2592"
Repository
Can you handle fixing this bug by yourself?
YES
NO
Preparing Pull Request
Which Release Cycle state this refers to? Info for developer.
Pick one option.
This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.
Environment details
Browser: Chrome 73
OS: Mac
Node: 8.11.4
Code Version: all, including 1.8.4, Master, Develop
Additional information
The text was updated successfully, but these errors were encountered:
Current behavior
Multiple related issues
File: /core/scripts/server.js
(1) As stated in the Express docs, maxAge is in milliseconds (it's converted to seconds for the Response Header cache-control: max-age value)
https://expressjs.com/en/api.html#express.static
So this value 60 * 60 * 24 * 30 = 2592000 milliseconds converts to 2592 seconds = 43 minutes and 12 seconds. Presumably it was intended to be 30 days.
(2) The above function call only has 2 parameters, the middle one is missing. It should be a boolean, that determines whether or not to set the max-age value. Instead the second parameter is an object, which converts to True, so service-worker.js gets a max-age value when it shouldn't.
(Modern browsers might ignore this, but it's still better to have a zero value. It can also be overwritten by the web server, such as Nginx, but it should be correct by default)
(3) The third parameter, "options" is also missing , so the Content-Type doesn't get set. Furthermore, setHeaders must be a function, not an object. As described in the docs:
https://expressjs.com/en/api.html#setHeaders
Expected behavior
Steps to reproduce the issue
"cache-control: public, max-age=2592"
Repository
Can you handle fixing this bug by yourself?
Preparing Pull Request
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Environment details
Additional information
The text was updated successfully, but these errors were encountered: