stale while revalidate

stale while revalidate 是 browser 提供的 cache 的機制,我們在很多靜態頁面上都會看到,例如: ``` Cache-Control: max-age=<seconds> Cache-Control: max-stale[=<second...

Wayne

Can't find custom headers in Axios response

It's CORS issue, configure CORS setting for browser will fix this. https://stackoverflow.com/questions/37897523/axios-get-access-to-resp...

Wayne

reset password token leaking

reset password 的網址常常是 https://yourdomain/password/reset?token=xxxx 但這樣就會被第三方網站從 `HTTP Referer` 內找到並紀錄起來 reset password 的 token,例如 googl...

Wayne

explain https again

CA 憑證方發憑證,所謂的憑證就是包含 1. 公鑰 2. 用 CA 方的私鑰加密過的 Hash ## 具體步驟是: 1. client端發起Https request 2. Server端返回CA發的憑證 3. Client端收到憑證,並驗證憑證是否可信,如果可...

Wayne

deploy vue to github page

兩個不錯的方式: 1. 用 push-dir + webpack 做 https://medium.com/@codetheorist/vue-up-your-github-pages-the-right-way-955486220418 2. 用直接寫好的 plug...

Wayne

bootstrap include grid

有時候會想要做到 include column 到自定義的 css class 裡面,可以這樣做: ``` @import "bootstrap"; .app { @include make-row(); div { border: solid 1px...

Wayne

網路安全相關 - JWT

JSON Web Token https://jwt.io/ 現在很流行用 JWT 當作 HTTP basic auth 的 token 通常會長這樣 ``` header["Authorization"] = "Bearer <YOUR_JWT>" ``` 什麼...

Wayne

SASS 做 theme 的起手式

不錯的文章 * 最外層的 container 控制 theme 基本元素 * 加上 themable 的 mixin 並設參數讓 theme 更彈性 * 用 each 方法 loop 參數,讓 themable 更彈性,只需要接受 name 和 map 兩個參數 * li...

Wayne

整理 SASS 的方法

教了很多整理 SASS 的方法,主要是用 mixins https://www.toptal.com/css/sass-mixins-keep-your-stylesheets-dry 偷懶也可以直接使用 Sass mixin libraries,例如文中提到的 bou...

Wayne

reddit 上的 rails performance 總結

The Complete Guide to Rails Performance 這本書 https://www.railsspeed.com/ 的總結: * Measure. If you have a serious project a cost of NewRelic...

Wayne

SSO single sign on

About SSO single sign on https://auth0.com/docs/sso/current TL;DR: 在 A 登入後自動登入 B,反之亦然

Wayne

CSS Grid

推薦連結: https://www.youtube.com/watch?v=txZq7Laz7_4&feature=share TL;DR: CSS grid 先把畫面切隔成不同的區塊後再把 content 丟到區塊裡,符合設計直覺 只套用第一層子元素 做 RWD ...

Wayne