Permalink
Browse files

Merge branch 'dev' into 3.4

  • Loading branch information...
2 parents fb42893 + 3de9bef commit 8c6a31d285ef23efcf1331d0bc1ff74074539d4a @mxstbr mxstbr committed Jan 14, 2017
View
@@ -49,6 +49,7 @@
# server config
.htaccess text
+.nginx.conf text
# git config
.gitattributes text
View
@@ -109,7 +109,8 @@ Now you're ready to rumble!
## Documentation
-- [Intro](docs/general): What's included and why
+- [**The Hitchhikers Guide to `react-boilerplate`**](docs/general/introduction.md): An introduction for newcomers to this boilerplate.
+- [Overview](docs/general): A short overview of the included tools
- [**Commands**](docs/general/commands.md): Getting the most out of this boilerplate
- [Testing](docs/testing): How to work with the built-in test harness
- [Styling](docs/css): How to work with the CSS tooling
View
@@ -28,7 +28,7 @@
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R,L]
# If we get to here, it means we are on https://
-
+
# If the file with the specified name in the browser doesn't exist
RewriteCond %{REQUEST_FILENAME} !-f
@@ -42,3 +42,11 @@
RewriteRule ^(.*) /
</ifModule>
+
+<IfModule mod_headers.c>
+ # Do not cache sw.js, required for offline-first updates.
+ <FilesMatch "sw\.js$">
+ Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
+ Header set Pragma "no-cache"
+ </FilesMatch>
+</IfModule>
View
@@ -81,6 +81,15 @@ server {
try_files $uri /index.html;
}
+# Do not cache sw.js, required for offline-first updates.
+ location /sw.js {
+ add_header Cache-Control "no-cache";
+ proxy_cache_bypass $http_pragma;
+ proxy_cache_revalidate on;
+ expires off;
+ access_log off;
+ }
+
##
# If you want to use Node/Rails/etc. API server
# on the same port (443) config Nginx as a reverse proxy.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -2,12 +2,13 @@
## Apache
-This boilerplate includes an `.htaccess` file that does two things:
+This boilerplate includes an `app/.htaccess` file that does three things:
1. Redirect all traffic to HTTPS because ServiceWorker only works for encrypted
traffic.
1. Rewrite all pages (e.g. `yourdomain.com/subpage`) to `yourdomain.com/index.html`
to let `react-router` take care of presenting the correct page.
+1. Ensure that sw.js is not cached. This is required for updates to be downloaded in offline-first mode.
> Note: For performance reasons you should probably adapt this to run as a static
`.conf` file (typically under `/etc/apache2/sites-enabled` or similar) so that
@@ -20,7 +21,7 @@ This boilerplate includes an `.htaccess` file that does two things:
## Nginx
-This boilerplate also includes an `.nginx.conf` file that does the same on Nginx server.
+An `app/.nginx.conf` file is included that does the same on an Nginx server.
### security
File renamed without changes.
File renamed without changes.
View
@@ -202,8 +202,8 @@
"app"
],
"moduleNameMapper": {
- ".*\\.(css|less|styl|scss|sass)$": "<rootDir>/mocks/cssModule.js",
- ".*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/mocks/image.js"
+ ".*\\.(css|less|styl|scss|sass)$": "<rootDir>/internals/mocks/cssModule.js",
+ ".*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/image.js"
},
"setupTestFrameworkScriptFile": "<rootDir>/internals/testing/test-bundler.js",
"testRegex": "tests/.*\\.test\\.js$"

0 comments on commit 8c6a31d

Please sign in to comment.