List Info

Thread: Use of multiple caches per page.




Use of multiple caches per page.
user name
2006-05-02 13:38:18
I want to be able to cache various pages, all called
index.php but
have various GET parameters for example like...

index.php?a=1

index.php?a=2&b=3

index.php?a=1&b=2&c=4

Can I store these the strings of GET parameters as the
cache_id's to
cache the various permutations of pages? (something like...
cache_id =
"a=1&b=2&c=4")

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

Use of multiple caches per page.
user name
2006-05-02 15:18:15
--- "Tony K." <tony.krusegmail.com> wrote:

> I want to be able to cache various pages, all called
index.php but
> have various GET parameters for example like...
> 
> index.php?a=1
> 
> index.php?a=2&b=3
> 
> index.php?a=1&b=2&c=4
> 
> Can I store these the strings of GET parameters as the
cache_id's to
> cache the various permutations of pages? (something
like... cache_id =
> "a=1&b=2&c=4")

Sure: http://smarty.php.net/manual/en/caching.multiple.cach
es.php

boots

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection
around 
http://mail.yahoo.com 

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php

Use of multiple caches per page.
user name
2006-05-04 14:41:24
boots wrote:
> --- "Tony K." <tony.krusegmail.com> wrote:
>   
>> I want to be able to cache various pages, all
called index.php but
>> have various GET parameters for example like...
>>
>> index.php?a=1
>>
>> index.php?a=2&b=3
>>
>> index.php?a=1&b=2&c=4
>>
>> Can I store these the strings of GET parameters as
the cache_id's to
>> cache the various permutations of pages? (something
like... cache_id =
>> "a=1&b=2&c=4")
>>     
>
> Sure: http://smarty.php.net/manual/en/caching.multiple.cach
es.php
>   

It's worth remembering that
    index.php?a=2&b=3
is the same page as
    index.php?b=3&a=2
and may also be the same as
    index.php?b=3&a=2&c=1
.. if c defaults to 1 in your code, but they'll all be
cached separately
by this method.

This may not matter to you, of-course, but if it does a more
sophisticated (application specific) cache ID generator is
needed. We
parse all passed parameters into a "$params"
array which also includes
default values; we then ksort, serialize and hash the result
to get an ID.

-- 
Mark Rogers
More Solutions Ltd :: 0845 45 89 555

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )