What is your MyCard?The New World OrderWho wants to be on the Advertising Team?



http://gtx0.com/user/plugins.php
Activate the "Like Button" plugin by highlighting it and clicking save.

You can now like posts and see a count of how many people liked the post. Clicking that will show a full list of the people who have liked that post, including you. The people list has the same style as other people lists (thread views, people here).

settingsOptions
There are 28 Replies

@Kohlrak:

Posted October 16th by Xhin
Xhin
 

Also plugins were apparently showing up universally for everyone and that's fixed now as well.

Posted October 16th by Xhin
Xhin
 

Oh wow, i didn't realize this actually would end up implemented. Now, to try it out.

Posted October 16th by Kohlrak
Kohlrak

I think there's a permissions issue, or something. Clicking like just sends me back to this post.

Posted October 16th by Kohlrak
Kohlrak

Have you tried Crtl + F5?

Often when Xhin implements new features they act odd because of cached junk.

Posted October 16th by Moonray
Moonray
 

That was it. Might want to fix the cause of that, though. Not everyone will Ctrl + F5 with such updates intuitively. There needs to be a way to uncache a page or javascript file with versioning or something. I hate webdev, or i'd know what it was and point you to it.

Posted October 16th by Kohlrak
Kohlrak

Versioning would help but it's annoying to do that every time and there's not a way of automating it really.

Posted October 16th by Xhin
Xhin
 

A thing me and a buddy once tried before was doing versioning based on dates. As soon as we "recompiled," it was already a new version, so we didn't even have to bother. Is it a javascript file, or what?

Posted October 16th by Kohlrak
Kohlrak

Then it loads every single time someone refreshes the page, which slows pageload time down considerably.

Posted October 16th by Xhin
Xhin
 

Yes it's a large javascript file.

Posted October 16th by Xhin
Xhin
 

Right, so you naturally do need it cached, normally, but uncached when the version changes.

I think there's a way to do this, but the issue of cache clearing makes this problem hard to google. There's ways to do this from php, javascript, etc. The issue is, you want to make it conditional. Maybe with an extra cookie, make the cookie match the version, and if the version doesn't match, update the cookie and clear the cache?

Posted October 16th by Kohlrak
Kohlrak

https://stackoverflow.com/questions/49547/how-to-control-web-page-caching-across-all-browsers
The cookie idea should work.

That said, it doesn't solve the rolling of massive changes slowing down as everyone updates at the same time, but that will happen simply because you're relying on a massive javascript file. Have you considered splitting the file up?

Posted October 16th by Kohlrak
Kohlrak

and if the version doesn't match, update the cookie and clear the cache?

That still requires me to manually update the versioning every time the file changes.

Or, it requires that the browser send a request for the javascript file every time, which has the load time/bandwidth problem.

Posted October 16th by Xhin
Xhin
 

Do you directly edit files on your server, or do you push them with git or something like that?

Posted October 16th by Kohlrak
Kohlrak

@Xhin:

Suggestion: also add a like button for the OP

Posted October 16th by Moonray
Moonray
 

The cookie idea should work.

yeah that makes the browser request the JS file anew every time it loads the page, which is not desirable.

Best idea I've come up with so far is some variation of:

1. Request the file like this: new.js?v=(some md5 hash)
2. Pull the hash out of the database. Or save it to a file or something.
3. Have something on the server occasionally scan the file and update the database's version of the hash of the file accordingly.

What would be ideal for #3 is this process happening as I save that specific file so there isn't load on the server like a one-minute cronjob that is only useful once every 1,675,231 attempts. Maybe I can configure my SFTP settings or something.

Posted October 16th by Xhin
Xhin
 

What's funny is we found the same solutions at the same time. XD

A slow way of doing this is making an alias for your sftp to then run an ssh command, but i'm still googling more reasonable and automatic answers.

Posted October 16th by Kohlrak
Kohlrak

The proposed fixes still don't solve the server load issue when everyone updates the js file at once, but if you can get a reasonable system started, you should be able to pull it off for multiple files, when you then take as an opportunity to split that javascript file into multiple parts which each get tracked and then invalidated with 1.

The idea is that this issue could cause problems down the road if you make a major change that's important. You don't want to have to avoid making necessary changes for fear it'll crash and burn.

Posted October 16th by Kohlrak
Kohlrak

The proposed fixes still don't solve the server load issue when everyone updates the js file at once,

That's not an issue.

I just don't want people requesting the file every single time they load any page (especially newest replies which gets tons of refreshes)

Posted October 16th by Xhin
Xhin
 

Also the ?v= thing is a totally legit way of fixing that particular problem, but without some kind of auto-scanning solution I have to update the places where that JS file is called each time it updates which gets old fast.

Posted October 16th by Xhin
Xhin
 

Well that much is easily fixed. The most efficient answer i have so far is aliasing in (client side) an additional call to SSH to run a command after sftp exits.

Posted October 16th by Kohlrak
Kohlrak

The actual script to edit what the file is called is easy, actually. The question, really, is where you want to store it.

Posted October 16th by Kohlrak
Kohlrak

Great we social media now.

Posted October 16th by KnokkelMillennium
KnokkelMillennium
The machiavellian menace

I'm not liking anything and I don't want anyone to like me!

Posted October 16th by Vandy
Vandy

Too bad, I liked your post because I agree with your sentiments.

Posted October 16th by KnokkelMillennium
KnokkelMillennium
The machiavellian menace

Same, Same

Now we need a dislike button.

Edited October 16th by Q
Q
 

social media


Reddit/slashdot/Digg are social media?

Posted October 16th by Xhin
Xhin
 

Actually, yes.

Posted October 16th by Kohlrak
Kohlrak
Reply to: Like button plugin

Enter your message here


Site Rules | Complaints Process | Register Complaint Facebook Page
GTX0 © 2009-2017 Xhin GameTalk © 1999-2008 lives on