I never quite understood why there is no way to ask the kernel for "weak memory" that can be deallocated at the kernel's whim.
No suitable to the OP's purpose: have reserved "optional" memory you could use for caching.
"The MADV_FREE operation can be applied only to private anonymous pages (see mmap(2)). In Linux before version 4.12, when freeing pages on a swapless system, the pages in the given range are freed instantly, regardless of memory pressure."