File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,26 @@ An `X-PJAX` request header is set to differentiate a pjax request from normal XH
243
243
244
244
Check if your favorite server framework supports pjax here: https://gist.github.com/4283721
245
245
246
+ #### Layout Reloading
247
+
248
+ Layouts can be forced to do a hard reload assets or html changes.
249
+
250
+ First set the initial layout version in your header with a custom meta tag.
251
+
252
+ ``` html
253
+ <meta http-equiv =" x-pjax-version" content =" v123" >
254
+ ```
255
+
256
+ Then from the server side, set the ` X-PJAX-Version ` header to the same.
257
+
258
+ ``` ruby
259
+ if request.headers[' X-PJAX' ]
260
+ response.headers[' X-PJAX-Version' ] = " v123"
261
+ end
262
+ ```
263
+
264
+ Deploying a deploy, bumping the version constant to force clients to do a full reload the next request getting the new layout and assets.
265
+
246
266
### Legacy API
247
267
248
268
Pre 1.0 versions used an older style syntax that was analogous to the now deprecated ` $.fn.live ` api. The current api is based off ` $.fn.on ` .
You can’t perform that action at this time.
0 commit comments