What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [PHP] How to cache base64 decoded images?

[PHP] How to cache base64 decoded images?
Author: Message:
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
O.P. [PHP] How to cache base64 decoded images?
I'm using base64_decode() for outputting images in KSMAS. I'm using now a rather big image in the header and I'd like to let it be cached by the browser, but I don't have a clue on how to do that.

I'm using he central script (index.php) to output images when it has an argument 'img' passed through GET. (like index.php?img=head)

The question is how to cache only certain outputs? :^)
09-08-2004 02:01 PM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: [PHP] How to cache base64 decoded images?
Send headers that tell the browser to cache it, and only send them with stuff you want cached? I'm not sure if it will work, but worth a try... :p

code:
// date in the past
header("Last-Modified: Tue, 01 Jul 2003 00:00:00 GMT");
// date in the future
header("Expires: ".gmdate("D, d M Y H:i:s", time() + 86400)." GMT");

As long as the URL stays the same (like index.php?img=head) I think it will work... :^)
09-08-2004 02:11 PM
Profile PM Web Find Quote Report
KeyStorm
Elite Member
*****

Avatar
Inn-sewer-ants-pollie-sea

Posts: 2156
Reputation: 45
38 / Male / –
Joined: Jan 2003
O.P. RE: [PHP] How to cache base64 decoded images?
Nice, it worked, thanks!

I didn't think this would work very well with parametric URLs as it usually causes browsers to avoid caching it :S

Anyway, I'm happy to know this works :D
09-08-2004 03:31 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On