Ive recently been working on a change for the search bar field. I have decided to add a toggled search bar inside of my navigation bar which is activated through jquery.
My form-mini.phtml is being called inside of topmenu.phtml like below once the search icon is clicked.
<?php include ($block->getTemplateFile('Magento_Search::form.mini.phtml')) ?>
Everything is working the way we would hope except for search terms entered in this field. The issue occurs when the first person who searches a product on the site will have their search cached and the value field will have their search term populated for everyone on the site trying to use the search function.
How would I stop the search from caching without setting cacheable="false" as I do not want to disable cache on every page of the site.
Cache: Varnish and Magento Full Page Cache