So I am able to get my page to prefetch with the following:
<link rel="prerender prefetch" href="<%= request.base_url + @prerender %>" as="HTML">
However it only seems to load the layout and not the API call I have in the rails controller. I am using a cURL call to a third party API for displaying a gif that shows the weather radar. This is all supposed to function on a loop of several pages (15 seconds each) and I want the next page (with API call) to load while the current one is displaying for ~15 seconds because the API call takes around 5 seconds.
I don't want 1/3 of the display time to be blank but it seems that prerender isn't running the Rails controller or cURL call. Does it not function this way or am I doing something wrong? I've tried prerender and prefetch by themselves as well as together. I've also tried various values for the as="" attribute.
This is my first stackoverflow post so I hope I was clear enough
Found a related question/answer that solved my problem. I'm calling the API ahead of time and saving the gif (overriding the old one every time to save space) so I can just link to the file within the project.