FoxInFlame Lovely person

Offline

Joined: Mar 2016

Posts: 312 OfflineJoined: Mar 2016Posts: 312

Annuvin said:

In that case you should at least implement some size limit, caching and compression in general. Every signature takes at least 2 seconds to load for me right now, that's way longer than all the other parts of MAL together.



//You can set compression and all the necessary headers in either apache's config or a .htaccess file. Might require some additional mods to be installed - mod_headers, mod_expires and probably something else.



As for the cache, the simplest way would be to just set a timeout for the script and update signatures every 5-10-30 (I dunno) minutes, otherwise just serve a static image generated from the previous script run.



//Almost forgot, seeing how long the script takes I'm guessing you're fetching the data directly from user profiles?

If that's the case you should probably try using

Fetch it with curl, parse as xml, count stats - voila. Will probably reduce the time significantly.

Let me know if you need an example. In that case you should at least implement some size limit, caching and compression in general. Every signature takes at least 2 seconds to load for me right now, that's way longer than all the other parts of MAL together.//You can set compression and all the necessary headers in either apache's config or a .htaccess file. Might require some additional mods to be installed - mod_headers, mod_expires and probably something else.As for the cache, the simplest way would be to just set a timeout for the script and update signatures every 5-10-30 (I dunno) minutes, otherwise just serve a static image generated from the previous script run.//Almost forgot, seeing how long the script takes I'm guessing you're fetching the data directly from user profiles?If that's the case you should probably try using http://myanimelist.net/malappinfo.php?u=USERNAME&status=all&type=anime Fetch it with curl, parse as xml, count stats - voila. Will probably reduce the time significantly.Let me know if you need an example.



1. I'll look into compressing, since I've never done that before.

2. The same for caching.

3. I fetch the data from the actual user profiles. I also did consider using the MALappinfo method, but then, the profile image won't be available. I don't know if it'll make it faster if I add in another fetch and still keep the old one for the image.



Do you know if there are tools (apps or websites) that would allow me to calculate the average time it takes to load? I would love to see some stats to see the improvements before and after so that I see I'm not doing anything wrong.



Relying on myself counting isn't that effective (XD), and it depends on the cache as well.



Basically, I want to see the exact time (possibly in milliseconds) it takes to load. 1. I'll look into compressing, since I've never done that before.2. The same for caching.3. I fetch the data from the actual user profiles. I also did consider using the MALappinfo method, but then, the profile image won't be available. I don't know if it'll make it faster if I add in another fetch and still keep the old one for the image.Do you know if there are tools (apps or websites) that would allow me to calculate the average time it takes to load? I would love to see some stats to see the improvements before and after so that I see I'm not doing anything wrong.Relying on myself counting isn't that effective (XD), and it depends on the cache as well.Basically, I want to see the exact time (possibly in milliseconds) it takes to load. BBCode MALembed