I have a Relay app and I want to clear cache for a component that displays after logging in. I tried passing a currentRelay.store into my Relay.Router and implementing a currentRelay.reset() which sets that store to a new Relay.Environment, then calling that after logout. The cache is still stored for some reason. I also tried calling this.props.relay.forceFetch({}) and this.forceUpdate() in componentDidMount(). The only way I can get the cache to clear is by manually refreshing the page. I wonder if there's a bug in Relay.Environment or I'm doing it wrong.
Clearing cache for log out in Relay.js app
1.5k Views Asked by Andrew F At
1
There are 1 best solutions below
Related Questions in REACTJS
- What is `_dereq_()` inside React?
- React TypeError: React.renderComponent is not a function
- React - saving a component in the ref callback
- React Rails component: manually triggering a re-render
- React, ES6 - getInitialState was defined on a plain JavaScript class
- How to get multiple selected options value in React JS?
- React.render replace container instead of inserting into
- reactjs datagrid use html
- props is not initialized in react component
- How to display xml data using Reactjs
- hooking up the data model in ReactJS - syntax
- ReactJS: How to use an immutable empty array or object
- How to use Sinon.js FakeXMLHttpRequest with superagent?
- React select onChange is not working
- ReactJS - Tutorial Comment System > Threaded commenting
Related Questions in CACHING
- ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
- Robospice. How to save data and how to get data from DB?
- Make @lru_cache ignore some of the function arguments
- Xib taking long time (>1s) to load. UIFont cache seems to blame
- Android picasso cache images
- Rails 4 low-level caching not working
- How to cache Exchange web service API autodiscoverurl?
- The process cannot access the file because it is being used by another process asp.net
- Alamofire loading from cache even when cache policy set to ReloadIgnoringLocalAndRemoteCacheData
- Java Heap vs Cache
- In what use cases is locking on ASP.NET cache required/desirable
- Chrome cache overriding angularjs disabling of cache
- AFNetworking 2.0 Cache Issue
- Symfony ESI Cache / Surrogate Listener Issue
- Using getOrElseUpdate of TrieMap in Scala
Related Questions in RELAYJS
- How to define Relay fragment for GraphQLList of GraphQLObjectType?
- relayjs: Attempted to add an ID already in GraphQLSegment:
- Authorization in GraphQL servers
- How does graphql-java library execute Relay requests?
- relayjs and graphql error: Error: "Node" expects field "id"
- unable to render nested props from Github's GraphQL
- Why does Relay need a mutation id to reconcile GraphQL mutations?
- Maintaining an ordered list in graphql/relay
- Delegating fragments to children with Relay
- Filtering a list of names with ReactJS using data from RelayJS without calling GrpahQL
- React-Relay older browser support (blank site)
- How do I set default props for a component wrapped in a Raley container?
- How do I filter Relay results based on values in fields on Connected Types?
- Can I pull deeply-nested nodes from a Relay query result?
- Does relay require an id field in the the database?
Related Questions in RELAY
- Single-Page App Sharing Relay Variables
- Difference between to Relay (with GraphQL) and Redux?
- Relay and ReactJS give an error when connecting to Github's GraphQL
- Why does Relay need a mutation id to reconcile GraphQL mutations?
- GraphQL + Relay + Graphene
- Relay flavoured graphql mutation validation errors
- Preserve React component state with Relay.setVariables
- Filtering a list of names with ReactJS using data from RelayJS without calling GrpahQL
- React-Relay older browser support (blank site)
- How do I set default props for a component wrapped in a Raley container?
- Get all values (even the empty ones) from Redux Form on Submit
- Can I pull deeply-nested nodes from a Relay query result?
- Does relay require an id field in the the database?
- Javascript variable statement as key value pair
- GraphQL cyclical reference using thunks - Error: field type must be Output Type but got: undefined
Related Questions in REACT-ROUTER-RELAY
- Single-Page App Sharing Relay Variables
- Can I pull deeply-nested nodes from a Relay query result?
- React relay injectNetworkLayer is not a function
- how to call multiple queries inside relay fragments?
- react-router-relay: handle sucess or error on mutation
- Handling query failures in react-router-relay
- Relay/router login mutation?
- '.' is not recognized as an internal or external command for relay full stack
- Sub route queries error for react-router-relay
- Invalid prop/context `relay`
- Clearing cache for log out in Relay.js app
- How to avoid multiple node queries?
- Callback when route is completely rendered
- How to wire data to a deep component in react-router-relay?
- Relay generating invalid query after using `setVariables`-- am I doing something wrong?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
in a environment file just get response cache from QueryResponseCache which you can get from relay-runtime im using 8.0.0 so you can check your verison of relay runtime and get queryresponsecache from relay-runtime
after jutst get token from localstorage if token is null then do cache.clear() e.g,