ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Announce Your Software/Service/Product

Forum Random Quotes Generator - salting your forum signature with wits

<< < (2/3) > >>

mouser:
do i understand that your running the script off mrcody, and each time a quote needs to be shown, your mycody.com hosted script re-downloads the quote file from users pc, and picks one and displays it.. each time? if so, you have reached new levels of figuring out how to slow down and kill a server, which i know personally you have been studying for the best ways to do it  :D :D :P :P

in all seriousness, if this is what you are doing you have to figure out a better way to do it, through caching, having people run php script locally, etc.  a good compromise might simply be to hash the parameter string and cache images and quote files, so that:
1) it regenerates a new image if the old one is over X minutes old.
2) it redownloads the quotes files if the old one is over Y days old.

Wordzilla:
Mouser, u scared me!

do i understand that your running the script off mrcody, and each time a quote needs to be shown, your mycody.com hosted script re-downloads the quote file from users pc, and picks one and displays it.. each time?
--- End quote ---

that's soooo untrue (otherwise plz rename my forum name to wordsucker  :D :D)! It fetches only a string with maximum length of 450 characters from the user server (consumes very little bandwidth). And the script on mrcody.com will stop running after 3 seconds of execution, so there's even less chance it could overload servers.

set_time_limit(3);
$len_limit = 450;
--- End quote ---

Remember the Random quote picker on the user server is responsible for picking out a single quote every time it runs.  :)

It is so designed that the user will not need PHP GD2 library on his server in order to get the thing to work (just call the text-to-image converter on mrcody.com to do the job), while offering the flexibility for him to script his own random quote generator (he may prefer getting quotes from mysql, adding more ASCII flavors to the end output quote, etc.)

Wordzilla:
Cool I just created a quotes file and it has been added to my signature as you can now see!  :)  :up:
-hamradio (May 14, 2007, 11:27 PM)
--- End quote ---

Awesome! And thanks for using the script! :Thmbsup:

It's fun to read words of wisdom!  :beerchug:

jgpaiva:
To avoid creating a new image everytime someone sees a page which contains the signature (which i think is what is happening now), you probably should cache the image and only reload it every few minutes... This is what allen does with his imagiine, which powers my signature :)

Wordzilla:
Thanks for the tip jgpaiva  :)

I'm afraid caching/re-validating could be more costly in terms of sys resource usage, with this script. Because the Text-to-image converter that is hosted on dc server simple grabs a <450 chars string from user server and output a 0.5-2kb image straightaway. If the script is now required to compare text, cache/revalidate images, there'd be much work for it to do, and it still has to output the 0.5-2kb image anyway.  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version