944,052 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2660
  • PHP RSS
Jan 26th, 2005
0

Dynamic precaching...

Expand Post »
Does anyone know how one would go about precaching some images for a page I'm creating? The trick is, I only know which pictures to precache at the very top of the script, so the list can't be stored in a .js file like normal. Since there are different pictures for different users, the script needs to precache the pictures dynamically. Anyone know how to?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
weexpectedthis is offline Offline
1 posts
since Jan 2005
Jan 28th, 2005
0

Re: Dynamic precaching...

I don't think you can do this with PHP, as PHP is a server side scripting language... that is too say every thing that PHP does is on the server not on the client aka the end user's computer. What you are talking about sounds like JavaScript but then you said no js because you vary your list...

the compromise:
why not generate several different js files and use a switch statement in PHP to dertemine which js file to load based on whatever permissions the user has

OR

you can be very fancy and use PHP to auto-generate your js files ... just make sure to output the correct headers so that your browser knows to read it as a js file and not a php file
Reputation Points: 13
Solved Threads: 4
Posting Whiz
paradox814 is offline Offline
351 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Php-nuke and MySQL trouble
Next Thread in PHP Forum Timeline: Site Icon





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC