Skip to content

Commit

Permalink
Revert "fix(qwik-city): Avoided unexpected caching for dynamic q-data (
Browse files Browse the repository at this point in the history
…QwikDev#6797)"

This reverts commit 7adb75a.
  • Loading branch information
maiieul committed Aug 26, 2024
1 parent 98165a1 commit 4a091aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/docs/src/repl/worker/app-bundle-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const appBundleClient = async (
srcInputs: getInputs(options),
// Older versions don't support `segment`
entryStrategy:
options.entryStrategy?.type === 'segment' ? { type: 'hook' } : options.entryStrategy,
options.entryStrategy.type === 'segment' ? { type: 'hook' } : options.entryStrategy,
manifestOutput: (m) => {
result.manifest = m;
},
Expand Down
16 changes: 2 additions & 14 deletions packages/qwik-city/src/runtime/src/use-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const loadClientData = async (
let resolveFn: () => void | undefined;

if (!qData) {
const fetchOptions = getFetchOptions(opts?.action, opts?.clearCache);
const fetchOptions = getFetchOptions(opts?.action);
if (opts?.action) {
opts.action.data = undefined;
}
Expand Down Expand Up @@ -88,21 +88,9 @@ export const loadClientData = async (
});
};

const getFetchOptions = (
action: RouteActionValue | undefined,
noCache: boolean | undefined
): RequestInit | undefined => {
const getFetchOptions = (action: RouteActionValue | undefined): RequestInit | undefined => {
const actionData = action?.data;
if (!actionData) {
if (noCache) {
return {
cache: 'no-cache',
headers: {
'Cache-Control': 'no-cache',
Pragma: 'no-cache',
},
};
}
return undefined;
}
if (actionData instanceof FormData) {
Expand Down

0 comments on commit 4a091aa

Please sign in to comment.