On Wed, Oct 15, 2008 at 8:17 AM, Massimiliano
<[EMAIL PROTECTED]> wrote:
> Because the <img> tag requires a URI in the src attribute. The
> original plugin constructs a $variable that is the link to the cached
> file. If I directly provide the $response variable, I'm providing the
> actual file (unless I'm missing something about RemoteRequest). In
> fact I get a string like
>
> ���t `�p41<� ��tZ��� b#o$3Bz�aqe Yv@
> x �1�)& ' '|$�) �
>
> If I simply return $response, I get a string like
>
> GIF89a)� �������������FFF���ttt\\\��� 444 $$$ ������!
> � ����,����)� �� � �A@ 3 � � G5�(�!I� � � �Av
> |� �Ch�A,F ��p 6S��tJ%T [EMAIL PROTECTED]"E&�>���t `�p41<� ��tZ��� b#o
> $3Bz�aqe Yv@
> x �1�)& ' '|$�) �;
>
> I can't think of other ways to return $response. BTW, now I'm using
> the condition that you suggested :)
> Massimiliano
If you don't want to create your own cache of the image files, you
would need to do a proxy of sorts. Your plugin would basically add a
rewrite rule then echo the appropriate Cache::get call for the
requested uri. So you might have /latex/some-hash-string.png, and
plugin retrieve 'some-hash-string' from cache. This means for every
request you load Habari twice, which is not great...
The other way, as I mentioned, is to create your own cache dir and
save the generated images there, linking to them directly, thus not
loading Habari twice.
note: You SHOULD NEVER NEVER NEVER link directly to habari's FileCache
data; in fact on my server I set cache dirs to a non-public facing
folder (not in docroot)... in my case define('FILE_CACHE_LOCATION',
'/var/www/mattread/cache/habari/'); in config.php.
--
Matt Read
http://mattread.com
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/habari-users
-~----------~----~----~----~------~----~------~--~---