diff --git a/packages/typescript/postman/src/postman/fetchOptions.ts b/packages/typescript/postman/src/postman/fetchOptions.ts deleted file mode 100644 index 201c00b..0000000 --- a/packages/typescript/postman/src/postman/fetchOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -const getNavigationEntries = (): PerformanceNavigationTiming[] => { - return performance.getEntriesByType('navigation') as PerformanceNavigationTiming[]; -}; - -export function fetchOptions(): RequestInit { - const pageHasRefreshed = getNavigationEntries().some((e) => e.type === 'reload'); - return pageHasRefreshed ? { cache: 'reload' } : {}; -} diff --git a/packages/typescript/postman/src/postman/request.ts b/packages/typescript/postman/src/postman/request.ts index 6db03b0..455f654 100644 --- a/packages/typescript/postman/src/postman/request.ts +++ b/packages/typescript/postman/src/postman/request.ts @@ -1,15 +1,5 @@ import type { Item, FontItem } from './item'; -const fetchOptions = (): RequestInit => { - const getNavigationEntries = (): PerformanceNavigationTiming[] => { - return performance - .getEntriesByType('navigation') as PerformanceNavigationTiming[]; - }; - const pageHasRefreshed = getNavigationEntries() - .some((e) => e.type === 'reload'); - return pageHasRefreshed ? { cache: 'reload' } : {}; -}; - export default { font(item: FontItem): Promise { const { fontFamily, href } = item; @@ -18,7 +8,7 @@ export default { script(item: Item): Promise { const { href } = item; - return fetch(href, fetchOptions()) + return fetch(href) .then((res) => res.text()) .then((text) => ({ type: 'application/javascript', text })) .then((props) => Object.assign(document.createElement('script'), props)); @@ -26,7 +16,7 @@ export default { css(item: Item): Promise { const { href } = item; - return fetch(href, fetchOptions()) + return fetch(href) .then((res) => res.text()) .then((text) => ({ innerText: text })) .then((props) => Object.assign(document.createElement('style'), props)); @@ -44,7 +34,7 @@ export default { json(item: Item): Promise { const { href } = item; - return fetch(href, fetchOptions()) + return fetch(href) .then((res) => res.text()) .then((text) => ({type: 'application/json', text})) .then((props) => Object.assign(props, item.props || {}))