Deleted the entire folder off the server
Redid all the songs using Cloudflare remote links
Sometimes it works - other times stalls or take 30 seconds to start playing the song
Why?
Just give it time?
Just uploaded ½ hour ago…
Thanks
-mike
Deleted the entire folder off the server
Redid all the songs using Cloudflare remote links
Sometimes it works - other times stalls or take 30 seconds to start playing the song
Why?
Just give it time?
Just uploaded ½ hour ago…
Thanks
-mike
Can you link to the page in question so we can do some testing?
Sorry Dan…
No worries. The playback is quite snappy once the page fully loads, but if you try to play a track while the page is still loading then yeah it stalls or takes time to start playing. That seems normal because your browser is doing a lot of work loading the page and pulling down all those audio files.
I noticed there’s no caching on your static assets. I’m assuming those .m4a files don’t change often. You could probably cache those aggressively, like for 1 year or something. That should help speed up page load speed/performance for your web visitors.
Also those audio files could probably benefit from lazy loading. As of now when you visit the page it loads all 100 audio files. That’s a lot of work for your server. Lazy loading would help mitigate that so only the audio files that come into the browser’s view pane would be pulled from Cloudflare, again helping with page load speed and performance.
Try searching in Gemini on the above and if you can’t get those things implemented let us know. ![]()
<script>
document.addEventListener("DOMContentLoaded", function() {
// 1. Find every stock audio element on the page
const allAudioPlayers = document.querySelectorAll("audio");
allAudioPlayers.forEach(function(audio) {
// 2. Force lazy loading: tell the browser NOT to load the file yet
audio.setAttribute("preload", "none");
// 3. Add an event listener so only ONE track plays at a time
audio.addEventListener("play", function() {
allAudioPlayers.forEach(function(otherAudio) {
// If another audio player is playing, pause it
if (otherAudio !== audio && !otherAudio.paused) {
otherAudio.pause();
}
});
});
});
});
</script>
Going to try this Gemini code after the menu…
The lazy loading seems to be working, and the pages are loading faster, for me anyway. ![]()
Where are you seeing that Too Many Requests error? If you are using a VPN or iCloud Private Relay make sure to switch that off, sometimes those IPs will get rate limited quickly.
iCloud private relay…
Turned off and worked fine ![]()
Copied this script to my other sites with lots of audio players
Solved many problems!