Skip to content

Commit

Permalink
Allow WebDriver BiDi to override the cache mode
Browse files Browse the repository at this point in the history
The primary use case here is allowing WebDriver to enforce that requests do not
use the network cache, including the CORS preflight cache. But for
future extension the this works by calling into WebDriver BiDi to get
a cache behavior for the request, which is then translated into
specific implementation on the fetch side (e.g. setting the request's
cache mode, or not using the preflight cache).

For now the only possible values of the cache behavior are "default"
and "bypass", so we only need to check for the latter value.
  • Loading branch information
jgraham committed Jul 3, 2024
1 parent d41ef17 commit 48fc0f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5237,6 +5237,8 @@ these steps:
<li>There is at least one <a for=list>item</a> in the <a>CORS-unsafe request-header names</a>
with <var>request</var>'s <a for=request>header list</a> for which there is no
<a>header-name cache entry match</a> using <var>request</var>.

<li><p><a>WebDriver BiDi cache behavior</a> with <var>request</var> is "<code>bypass</code>".
</ul>

<p>Then:
Expand Down Expand Up @@ -5615,6 +5617,9 @@ run these steps:
<a>default `<code>User-Agent</code>` value</a>) to <var>httpRequest</var>'s
<a for=request>header list</a>.

<li><p>If <a>WebDriver BiDi cache behavior</a> with <var>request</var> is "<code>bypass</code>, then
set <var>httpRequest</var>'s <a for=request>cache mode</a> to "<code>no-store</code>".

<li><p>If <var>httpRequest</var>'s <a for=request>cache mode</a> is "<code>default</code>" and
<var>httpRequest</var>'s <a for=request>header list</a> <a for="header list">contains</a>
`<code>If-Modified-Since</code>`,
Expand Down Expand Up @@ -6495,8 +6500,9 @@ populates the <a>CORS-preflight cache</a> to minimize the number of these
<li><p>If <var>max-age</var> is greater than an imposed limit on
<a for="cache entry">max-age</a>, then set <var>max-age</var> to the imposed limit.

<li><p>If the user agent does not provide for a <a lt="CORS-preflight cache">cache</a>, then
return <var>response</var>.
<li><p>If the user agent does not provide for a <a lt="CORS-preflight cache">cache</a>,
or <a>WebDriver BiDi cache behavior</a> with <var>request</var> is "<code>bypass</code>",
then return <var>response</var>.

<li><p>For each <var>method</var> in <var>methods</var> for which there is a
<a>method cache entry match</a> using <var>request</var>, set matching entry's
Expand Down

0 comments on commit 48fc0f9

Please sign in to comment.