How to prevent an Apollo Client Query from caching in IE11?
up vote
0
down vote
favorite
We can disable caching globally in jQuery by doing:
$.ajaxSetup({ cache: false });
I'm trying to find a similar option in Apollo Client. I've tried Middleware and Cache-Control headers without luck.
Is it possible to disable cache in a similar way (i.e., by appending a timestamp to the query string) as the previous jQuery option does?
internet-explorer-11 apollo-client
add a comment |
up vote
0
down vote
favorite
We can disable caching globally in jQuery by doing:
$.ajaxSetup({ cache: false });
I'm trying to find a similar option in Apollo Client. I've tried Middleware and Cache-Control headers without luck.
Is it possible to disable cache in a similar way (i.e., by appending a timestamp to the query string) as the previous jQuery option does?
internet-explorer-11 apollo-client
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
We can disable caching globally in jQuery by doing:
$.ajaxSetup({ cache: false });
I'm trying to find a similar option in Apollo Client. I've tried Middleware and Cache-Control headers without luck.
Is it possible to disable cache in a similar way (i.e., by appending a timestamp to the query string) as the previous jQuery option does?
internet-explorer-11 apollo-client
We can disable caching globally in jQuery by doing:
$.ajaxSetup({ cache: false });
I'm trying to find a similar option in Apollo Client. I've tried Middleware and Cache-Control headers without luck.
Is it possible to disable cache in a similar way (i.e., by appending a timestamp to the query string) as the previous jQuery option does?
internet-explorer-11 apollo-client
internet-explorer-11 apollo-client
asked Nov 7 at 16:55
Lenin
309412
309412
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
Try to set the fetchPolicy to "no-cache". like this:
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
Code from this link.
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
add a comment |
up vote
0
down vote
haci soy yo
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Try to set the fetchPolicy to "no-cache". like this:
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
Code from this link.
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
add a comment |
up vote
0
down vote
Try to set the fetchPolicy to "no-cache". like this:
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
Code from this link.
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
add a comment |
up vote
0
down vote
up vote
0
down vote
Try to set the fetchPolicy to "no-cache". like this:
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
Code from this link.
Try to set the fetchPolicy to "no-cache". like this:
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
Code from this link.
answered Nov 8 at 8:06
Zhi Lv - MSFT
30713
30713
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
add a comment |
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
I tried this and IE11 still caches the request (Edge, and any other browser, does not cache it as expected). I think we only have two options: 1. Use a query string timestamp 2. Use Cache-Control headers (see stackoverflow.com/q/4303829/2009886). I'm looking for an option to intercept my Apollo queries and inject a timestamp to the query string (or a similar option).
– Lenin
Nov 9 at 11:30
add a comment |
up vote
0
down vote
haci soy yo
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
add a comment |
up vote
0
down vote
haci soy yo
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
add a comment |
up vote
0
down vote
up vote
0
down vote
haci soy yo
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
haci soy yo
const defaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
}
const client = new ApolloClient({
link: concat(authMiddleware, httpLink),
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
});
edited Nov 10 at 18:29
AS Mackay
1,7153816
1,7153816
answered Nov 10 at 7:47
Bertha Alicia Cárdenas Molina
1
1
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194201%2fhow-to-prevent-an-apollo-client-query-from-caching-in-ie11%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown