PageSourceSearch

https://docs-pactflow-preview.netlify.app/assets/js/bf8f15b9.46fa679c.js

js docs-pactflow-preview.netlify.app collected 2026-10-03 10:40:53 UTC 6,540 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkpartners=self.webpackChunkpartners||[]).push([[12548],{15680:(e,r,t)=>{t.d(r,{xA:()=>p,yg:()=>y});var n=t(96540);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function o(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)t=s[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var l=n.createContext({}),c=function(e){var r=n.useContext(l),t=r;return e&&(t="function"==typeof e?e(r):i(i({},r),e)),t},p=function(e){var r=c(e.components);return n.createElement(l.Provider,{value:r},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},m=n.forwardRef((function(e,r){var t=e.components,a=e.mdxType,s=e.originalType,l=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=c(t),m=a,y=d["".concat(l,".").concat(m)]||d[m]||u[m]||s;return t?n.createElement(y,i(i({ref:r},p),{},{components:t})):n.createElement(y,i({ref:r},p))}));function y(e,r){var t=arguments,a=r&&r.mdxType;if("string"==typeof e||a){var s=t.length,i=new Array(s);i[0]=m;var o={};for(var l in r)hasOwnProperty.call(r,l)&&(o[l]=r[l]);o.originalType=e,o[d]="string"==typeof e?e:a,i[1]=o;for(var c=2;c<s;c++)i[c]=t[c];return n.createElement.apply(null,i)}return n.createElement.apply(null,t)}m.displayName="MDXCreateElement"},80879:(e,r,t)=>{t.r(r),t.d(r,{assets:()=>l,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>o,toc:()=>c});var n=t(58168),a=(t(96540),t(15680));const s={title:"Cache"},i=void 0,o={unversionedId:"docs/on-premises-2x/redis",id:"docs/on-premises-2x/redis",title:"Cache",description:"Introduction",source:"@site/docs/docs/on-premises-2x/redis.md",sourceDirName:"docs/on-premises-2x",slug:"/docs/on-premises-2x/redis",permalink:"/docs/on-premises-2x/redis",draft:!1,editUrl:"https://github.com/pactflow/docs.pactflow.io/edit/master/website/docs/docs/on-premises-2x/redis.md",tags:[],version:"current",lastUpdatedBy:"Matt Fellows",lastUpdatedAt:1751508618,formattedLastUpdatedAt:"Jul 3, 2025",frontMatter:{title:"Cache"},sidebar:"onprem",previous:{title:"Database",permalink:"/docs/on-premises-2x/database"},next:{title:"Observability",permalink:"/docs/on-premises-2x/observability"}},l={},c=[{value:"Introduction",id:"introduction",level:2},{value:"Session management",id:"session-management",level:2},{value:"Caching",id:"caching",level:2},{value:"Supported versions",id:"supported-versions",level:2}],p={toc:c},d="wrapper";
1function u(e){let{components:r,...t}=e;return(0,a.yg)(d,(0,n.A)({},p,t,{components:r,mdxType:"MDXLayout"}),(0,a.yg)("h2",{id:"introduction"},"Introduction"),(0,a.yg)("p",null,"PactFlow requires a Redis Serialization Protocol (RESP)-compatible storage engine to support the following functions:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"User session management"),(0,a.yg)("li",{parentName:"ul"},"UI caching for improved performance")),(0,a.yg)("h2",{id:"session-management"},"Session management"),(0,a.yg)("p",null,"User sessions are stored in Redis. Only a 128-bit session ID is shared with the user's browser. This ID is valid for 30 days and is signed with a server-side secret to prevent tampering\u2014regardless of the cookie's expiry time. This protects against cookie replay attacks."),(0,a.yg)("p",null,"All user data, including ",(0,a.yg)("inlineCode",{parentName:"p"},"idToken")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"accessToken"),", is stored server-side and is never exposed to the user."),(0,a.yg)("h2",{id:"caching"},"Caching"),(0,a.yg)("p",null,"To improve UI performance, PactFlow uses a server-side caching layer."),(0,a.yg)("p",null,"This may result in temporary staleness\u2014displayed content can differ based on when data was last fetched. Differences may appear between users or across browser sessions."),(0,a.yg)("p",null,"PactFlow uses a ",(0,a.yg)("em",{parentName:"p"},"per-user")," server-side cache, following a ",(0,a.yg)("inlineCode",{parentName:"p"},"stale-while-revalidate")," strategy:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Hot cache:")," Data is used without validation."),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Warm cache:")," Data is served immediately, and the cache is refreshed in the background."),(0,a.yg)("li",{parentName:"ul"},(0,a.yg)("strong",{parentName:"li"},"Cold cache:")," The UI blocks until data is fetched from the API.")),(0,a.yg)("p",null,"This approach balances performance and freshness."),(0,a.yg)("p",null,"When a user writes data through the UI, their ",(0,a.yg)("em",{parentName:"p"},"entire user cache")," is invalidated immediately. This ensures correctness for the current user. However, if the change is made by another user or via the API, it may take longer to appear."),(0,a.yg)("p",null,"As a fallback, the PactFlow UI follows HTTP cache-control conventions. If a user performs a hard refresh (",(0,a.yg)("inlineCode",{parentName:"p"},"Shift+Refresh"),"), the browser sends headers like ",(0,a.yg)("inlineCode",{parentName:"p"},"Cache-Control: no-cache")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"Pragma: no-cache"),", which bypass the cache."),(0,a.yg)("h2",{id:"supported-versions"},"Supported versions"),(0,a.yg)("p",null,"Engines that implement the ",(0,a.yg)("a",{parentName:"p",href:"https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md"},"Redis Serialization Protocol (RESP) version 3")," are supported."),(0,a.yg)("p",null,"Example implementations include:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Redis"),(0,a.yg)("li",{parentName:"ul"},"Valkey")))}u.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.