M00se0nTheLoose

Dr. h.c., Reverend, Lord

Just a dude looking for better Social Media

Profile Gif from @Shalmons

last fm recently played music


Personal Website
tanzi-media.com/

So, I saw someone else put in their profile their last fm recently played music. I thought this was cool, so attempted to recreate it myself by typing this into the "description" section of my profile:

last fm recently played music

![last fm recently played music](https://lastfm-recently-played.vercel.app/api?user=isat32196)

However, I ran into an issue


The Issue

So, I quickly came to realize that it wasn't updating as I listened to more songs. It would update once I clicked "Save" to my settings, but if I went back to my profile once I began listening to a new song, it would not update to the new song.

If I went directly to the web address linked above (https://lastfm-recently-played.vercel.app/api?user=isat32196), that was updated with my current song. If I then reloaded my profile on CoHost, it would be updated.

I tested this in both Chrome and Firefox on Windows 11, and experienced the same issue.

My assumption is that it's a website caching thing, where Firefox/ Chrome are seeing it as an image and going "i've already loaded that, so I won't check again". But then when I actually go to the site it sort of forces the web browsers to update.

But my question is is there any way to solve this issue? I assume there'd be a way for me to tell Firefox to not pull from the cache for a specific site, or to refresh the cache, but that doesn't really solve the issue as if someone else checked out my profile more than once, they'd still see the list of songs from the first time they checked the profile. I'm not familiar enough with markdown/html/coding in general to know of a better way to embed that link so it updates each time someone loads the page.

Edit 1 (Shortly after posting)

So, I was curious to see if this post loaded the songs better. I refreshed the page 2-3 times after making this post, and sure enough it did update. So I'm not sure if maybe it's just something with the "description" part of the profile page.

I re-added it to my profile page in case that helps anyone

Edit 2 (Shortly after edit 1)

So, I noticed with this post up, my description section version started working where it would update as I listened to things. So I deleted this post, looked at my description section, tried switching songs, and sure enough it wasn't keeping up again.

I then remade this post, and it didn't seem to be keeping up, but would show my last played song (so, not the currently playing one). I thought this was odd, given it had just worked, so checked the source at the URL again and I think I might've caused Last.fm to glitch from switching so much, because even at the URL (at the time of writing) it keeps showing my previously played song as the song I'm currently listening to. (Edit: LastFm likes making me look like a fool, because right after I posted this it's now caught up to what I'm actually listening to -_-) This still shows though that, with this post, it causes the description section to update.

My current guess then is that posts reload everything when you look at them, where the description section is more static? Meaning a possible solution would be for me to just pin a post to the top of my page with my last fm recently played music. That's a solution I'll probably go with if no one else has anything, but wanted to put this out there in case anyone has any ideas

Edit 3 (2023.08.08 484 Internet Time)

@vikingstid in the comments mentioned they remember reading about someone having a similar issue who went in depth with their findings. But what they could remember was that when other people view your profile it works as it should, but when you view your own profile you're viewing a cached version.

To test this, I removed the Recently Played image from this post, and began playing music/ refreshing my page. It seemed to work as it should for a moment, before getting what I'd consider "Stuck" (the now playing song wasn't updating correctly). So I opened a separate browser and logged into my alt account, and viewed my profile. It also was stuck. I refreshed the page and then everything updated. When I went back to Firefox to my main account, and reloaded the page, it also had updated in the description section.

So, it seems to be working? I'll need to keep an eye on it. What makes this even more troublesome to troubleshoot is that Last.Fm doesn't seem to update perfectly on its end either. When I first went to test this, nothing was updating and I got worried. I went to the link directly, and it hadn't updated either. It took probably 30 seconds- a minute before Last.FM updated on its side I was listening to anything


You must log in to comment.

in reply to @M00se0nTheLoose's post:

I swear I have read a thread of someone exploring this very issue previously, but for the life of me I could not find it again while browsing on my lunch break :( However if I remember correctly, the conclusion they came to is something like: your own profile page is cached for you, meaning it will take something like a post or ctrl+F5 refresh to update the widget view for you, but anyone else browsing your profile who gets it loaded for them will get up-to-date info immediately. So, it only looks like it's stuck to you, for everyone else it should work just fine as is.

I'll keep trying to find the original thread I saw though because it had a lot more work put into it than my vague recollections. I hope this might have been at least a bit helpful!