Missing Document are coming in _change feeds

So according to what I understood if I reduce or remove “channel_cache_expiry”: 600. Will it remove from the cache of sync gateway. Because restarting the sync gateway surely removed it from change request.

Secondly is it possible to create a temporary document in couch-base to notify syncgateways that this document which was part of these channels have been purged, and please remove from the cache.

And this document should live for max amount of cache expiry time + some grace period.

This do create issues when there are high number of documents and those documents are not required after some days in the app. If we soft delete them then tombstone is sent to device. And there is no way to remove tombstones from the app.

The point can be said that the tombstones are not heavy and wont have much effect but what if in an app running for 6 months have 1 million tombstone documents. Then it does make an impact.

if I set TTL or Use expiry_timestamp in the app for documents then I am getting crash in the app because of

If I try to emit deleted document in a mapper then the document body is null, means the document.getproperties returns null. And I am not sure whether we can emit the deleted documents or not.

Please help me out of this. Because I dont want to go in SQL directly and run queries. Because that may not be supported in Enterprise support.

Please do note that in every 7 days each app will get 50000 new documents, and 50000 documents will be deleted after some time of new documents arrive.

The best thing which can work for me is if the crash can be removed. Then everything is set up for the release.