Re: how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2009-08-26 Thread wtanaka.com

This is a wrapper function and some instructions for enabling caching
of the /jsi18n/ javascript string catalog: http://wtanaka.com/django/jsi18ncache

--~--~-~--~~~---~--~~
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: how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2008-03-06 Thread alain D.

Thanks for the precise reply ... looking forward to know about your
ideas on this matter ...
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2008-03-05 Thread Malcolm Tredinnick


On Wed, 2008-03-05 at 14:33 -0800, jfine wrote:
> On Mar 5, 5:58 pm, "alain D." <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> >If there a simple apache configuration that is know to make browser
> > cache the javascript message file ('jsi18n') in a standard apache
> > django production setup ?
> 
> [snip]
> 
> >   To my django virtual host and then I get this headers in the reply :
> >   HTTP/1.1 200 OK
> >   Date: Wed, 05 Mar 2008 17:54:25 GMT
> >   Server: Apache
> >   Vary: Accept-Language,Cookie,Accept-Encoding
> 
> Thank you for sending clear and precise information.  I think the
> problem lies with the Vary: header.  Are you sure you want to tell the
> cache that the javascript depends on the cookie?

It has to depend on the localisation cookie. The jsi18n URL is mapped to
the django.views.i18n.javascript_catalog view. This produces a file
containing the translation strings for the requester's currently active
language. Since the currently active language can be stored in the
language cookie, the cache for that URL must depend vary on "cookie".

This is fairly tricky to work around, since web pages need a single URL
they can refer to in order to pull in the translation file, regardless
of the user's active language choice for that particular request.

Short version: it's pretty much impossible to cache that file directly. 

I have a couple of ideas to try and experiment with in the future, but
it's not the highest priority item at the moment.

Regards,
Malcolm

-- 
Borrow from a pessimist - they don't expect it back. 
http://www.pointy-stick.com/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to cache django javascript message file ('/jsi18n/') with apache (production setup)

2008-03-05 Thread jfine

On Mar 5, 5:58 pm, "alain D." <[EMAIL PROTECTED]> wrote:
> Hi,
>
>If there a simple apache configuration that is know to make browser
> cache the javascript message file ('jsi18n') in a standard apache
> django production setup ?

[snip]

>   To my django virtual host and then I get this headers in the reply :
>   HTTP/1.1 200 OK
>   Date: Wed, 05 Mar 2008 17:54:25 GMT
>   Server: Apache
>   Vary: Accept-Language,Cookie,Accept-Encoding

Thank you for sending clear and precise information.  I think the
problem lies with the Vary: header.  Are you sure you want to tell the
cache that the javascript depends on the cookie?

Hope this help.
--
Jonathan
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---