Re: incrementing counter of an cached data

2011-02-07 Thread Michel Thadeu Sabchuk
You can hit the counter through ajax and still keep the cache of the
entire page. This is useful if you have a cache through nginx +
memcached.

Regards,

On 7 fev, 20:15, "Henrik Genssen" <henrik.gens...@miadi.net> wrote:
> are you using middleware or a decorator for caching your view?
> if you are using a decorator like @cache_page from 
> django.views.decorators.cache you can add simply a second decorator befor the 
> caching one, where you count your hits...
> if you are using a middleware, you have to write your own cache middleware 
> (copy the existing and add you counter)
>
> regards
>
> Hinnack
>
> >reply to message:
> >date: 07.02.2011 22:53:10
> >from: "ozgur yilmaz" <yelb...@gmail.com>
> >to: django-users@googlegroups.com
> >subject: Re: incrementing counter of an cached data
>
> >No suggest?
>
> >2011/2/7 ozgur yilmaz <yelb...@gmail.com>
>
> >> Hi,
>
> >> I'm using file caching. But need to increment a field for storing product
> >> hits. Is there an optimal way to do this?
>
> >> Thanks,
>
> >--
> >You received this message because you are subscribed to the Google Groups 
> >"Django users" group.
> >To post to this group, send email to django-users@googlegroups.com.
> >To unsubscribe from this group, send email to 
> >django-users+unsubscr...@googlegroups.com.
> >For more options, visit this group 
> >athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: Re: incrementing counter of an cached data

2011-02-07 Thread Henrik Genssen
are you using middleware or a decorator for caching your view?
if you are using a decorator like @cache_page from 
django.views.decorators.cache you can add simply a second decorator befor the 
caching one, where you count your hits...
if you are using a middleware, you have to write your own cache middleware 
(copy the existing and add you counter)

regards

Hinnack

>reply to message:
>date: 07.02.2011 22:53:10
>from: "ozgur yilmaz" <yelb...@gmail.com>
>to: django-users@googlegroups.com
>subject: Re: incrementing counter of an cached data
>
>No suggest?
>
>2011/2/7 ozgur yilmaz <yelb...@gmail.com>
>
>> Hi,
>>
>> I'm using file caching. But need to increment a field for storing product
>> hits. Is there an optimal way to do this?
>>
>> Thanks,
>>
>
>-- 
>You received this message because you are subscribed to the Google Groups 
>"Django users" group.
>To post to this group, send email to django-users@googlegroups.com.
>To unsubscribe from this group, send email to 
>django-users+unsubscr...@googlegroups.com.
>For more options, visit this group at 
>http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
No suggest?

2011/2/7 ozgur yilmaz 

> Hi,
>
> I'm using file caching. But need to increment a field for storing product
> hits. Is there an optimal way to do this?
>
> Thanks,
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
Hi,

I'm using file caching. But need to increment a field for storing product
hits. Is there an optimal way to do this?

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.