You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Tommie Podzemski <li...@tommie.nu> on 2008/06/13 12:11:13 UTC

Caching in the php implementation

Hi,

Is it correct to assume that the engine only caches the mod itself and 
not the actual requests done from the module, such as a remote XML request?

Reason for asking this is that I've encountered some issues in regards 
of using nocache=1 in the url. It doesn't seem to have any effect. 
Changing 'cache_time' in the config to 0 or emptying /tmp/shindig seems 
to be solving the "issue", yet i'd rather go with proper caching.

Anyone got some documentation on the cache-function?

Kind regards,
Tommie


Re: Caching in the php implementation

Posted by Chris Chabot <ch...@xs4all.nl>.
Hey Tommie,

When you specificy ?nocache=1 in the -iframe url-, shindig -should  
not- cache the requests made, if it does please file a bug so i can  
solve that :-)

However in every other situation it -should- cache all the (get)  
requests (post's are not cached obviously).

There are two things you could do to prevent that: specify a low  
REFRESH_INTERVAL in the gadgets.io.makeRequest call, or use a cache  
busting technique (?foo=<timeInMs>).

However you usually do want caching to happen, it helps your gadget  
and your servers survive being popular on myspace/orkut/hi5; Plus  the  
CDN's of the container will make sure your gadget is a lot faster for  
all people too then when it's non cached..

The "OpenSocial Latency Combat Field Manual" guide gives some nice  
tips on how to fight latency: http://code.google.com/apis/opensocial/articles/latency/index.html 
  getting gadgets to be lightning fast is a big issue, if you load to  
slow people won't use it as much, so caching is a good thing! :-)

Btw There's a hack in partuza for a 'never cache' flag (?nocache=1 in  
the -xml file url-), it's a trick imeem does as well which can be  
useful for development... however thats a container specific trick and  
not related to shindig, all it does is see if there's a nocache=1 on  
the xml url, and if so always puts ?nocache=1 in the iframe url.

	-- Chris

On Jun 13, 2008, at 12:11 PM, Tommie Podzemski wrote:

> Hi,
>
> Is it correct to assume that the engine only caches the mod itself  
> and not the actual requests done from the module, such as a remote  
> XML request?
>
> Reason for asking this is that I've encountered some issues in  
> regards of using nocache=1 in the url. It doesn't seem to have any  
> effect. Changing 'cache_time' in the config to 0 or emptying /tmp/ 
> shindig seems to be solving the "issue", yet i'd rather go with  
> proper caching.
>
> Anyone got some documentation on the cache-function?
>
> Kind regards,
> Tommie


Re: Caching in the php implementation

Posted by Eiji Kitamura <ag...@gmail.com>.
Hi,


I believe Chris will answer you in detail pretty soon but, I had same
question and here's Chris's answer.

> When ?nocache=1 is provided on the gadget iframe url it will always bypass the cache for that gadget. that doesn't work for makeRequest though, only for the gadget iframe url
>
> However 0.8 does add a new option: REFRESH_INTERVAL (time in seconds to cache the request), set this to something low to make sure it refreshes often.
>
> If you really don't ever want to cache, cache busting techniques are your best bet (append ?random=timeInMs or something)

Hope this helps.


2008/6/13 Tommie Podzemski <li...@tommie.nu>:
> Hi,
>
> Is it correct to assume that the engine only caches the mod itself and not
> the actual requests done from the module, such as a remote XML request?
>
> Reason for asking this is that I've encountered some issues in regards of
> using nocache=1 in the url. It doesn't seem to have any effect. Changing
> 'cache_time' in the config to 0 or emptying /tmp/shindig seems to be solving
> the "issue", yet i'd rather go with proper caching.
>
> Anyone got some documentation on the cache-function?
>
> Kind regards,
> Tommie
>
>