Caching
Bread has a very detailed & intelligent caching mechanism built in to help load the documents faster. Caching of document is done all on server side.
To understand caching, we will first understand the document flow. When document is loaded into editor, it is also cached in to the Bread server.
So the workflow for loading a new document ‘test’ looks like below:
Now if the same document is loaded again, then the workflow works as below
As you can see in above, the changes made by users to document are retained in Bread server cache and loaded on next request. Of course, you can clear the cache for a document and forces update the cache. We will show you later here on how to do that.
No additional action is required on your part to maintain the cache. Simply pass the document location or url of document and Bread makes a decision on whether it is a new document or it has an existing cache of the document.
Note- If you passed a document ‘test’ to Bread to load and then modified the original document, Bread would identify it as a new updated document on next request and load the new modified original document and not the document in cache. The original document with users changes in Bread cache will be updated with this new modified document.
forceUpdate
forceUpdate is a parameter that can be used to update the cache of document in Bread. You can use this to update cache, when original document has changed or when you want a different document to be replaced by original etc.
forceUpdate does not change the breaddocid or breadsheetid. It forces the new content into the cache for same existing breaddocid or breadsheetid
Flowchat for forceUpdate looks like below:
Note – forceUpdate updates the document in Bread cache and all user changes & updates to document are overwritten in cache with new document. Versioning is still maintained even for older content.
forceLoad
forceLoad is a parameter that can be used to update the document under a new breaddocid or breadsheetid temporarily. forceLoad should be used when you want to load a document one time from the original document. Document is always loaded from original source and cache is ignored.
Flowchat for forceLoad looks like below: