In this guide, we will show you how to reduce real-time (XHR/Ajax) requests to your website when a user or tab has been inactive for a specified duration. This can be beneficial to improve the performance of your website and reduce unnecessary server load. We're going to use a script hosted at `https://cdn.coalias.com/coalias_reduce_requests.v1.min.js`.
Please follow the instructions relevant to your no-code platform.
Bubble.io:
1. Open your Bubble.io app editor.
2. Navigate to the page where you want to implement this feature.
3. In the Design tab, select the page name in the Element Tree.
4. Find the 'Page HTML Header' text box in the 'Property Editor' pane on the left.
5. Paste the following script tag into the 'Page HTML Header' box:
<script id="coalias_reduce_requests" data-timeout="15" src="https://cdn.coalias.com/coalias_reduce_requests.v1.min.js"></script>
6. Adjust the `data-timeout` attribute to set the duration of inactivity (in minutes) after which real-time requests will be reduced. For example, for a 30-minute timeout, change the attribute to `data-timeout="30"`.
7. Test the feature by clicking 'Preview' in the Bubble.io editor.