Important things to know about headers for dynamic resources

Document created by B-F-F08DRX Employee on Jul 19, 2017Last modified by B-F-F08DRX Employee on Sep 25, 2017
Version 6Show Document
  • View in full screen mode

Below are important points to know when using Dynamic Resource in any page.


1. If the Main HTML Doc of the page has the headers "Connection:keep-alive", they'll get passed to the dynamic resources. The same goes for the header "Accept-Encoding: gzip, deflate, sdch".


The above helps, but there is an issue when recording with the Conductor; it turns out that since the Conductor acts as a proxy when recording, websites return the header "Proxy-Connection: keep-alive" and that is being recorded in the clip. So if you set up your clip pages to dynamic, the resources won't have "Connection:keep-alive" since the actual header in the main HTML Doc is "Proxy-Connection: keep-alive" and that is not propagated. And in the real world, most users won't use a proxy. So the clips should really have Connection:keep-alive instead of Proxy-Connection: keep-alive.


What you can do to solve the above is use Find and Replace to search for "Proxy-Connection: keep-alive" in the clip and replace it for "Connection:keep-alive" so that the header is now "Connection:keep-alive" and when setting pages to dynamic, the "Connection:keep-alive" header will be propagated.


The above should be done as a best practice just after recording any clip.


2. When adding dynamic resources via JS to the page with the below line, the new just added resources won't have any of the headers added from the parent such as Accept-Encoding or Connection and won't be cached. The first issue is solved with adding a JS to add the headers that are missing. For the second issue, there is no simple solution.


$context.currentPage.dynamicResourceLinks = newDynamicResourceLinks;