Suggestion for @cache_page compatiblity with jQuery JSONP

40 views
Skip to first unread message

Luke Dupin

unread,
Oct 22, 2014, 1:16:48 AM10/22/14
to django-d...@googlegroups.com
Anyone that has used @cache_page with jquery's JSONP knows that it does nothing.  The URL is different for every call, therefor nothing gets cached.

I suggest that a parameter is added to @cache_page which causes certain URL variables to be removed from the URL before the url is cached.  I'm picturing something like this:
@cache_page(60 * 15, ignore_variables=('callback',))

Another approach is to allow the user to pass REGEX(s) to sub out portions of the URL.  This will allow more flexibility, but is probably a bit overkill.

Florian Apolloner

unread,
Oct 22, 2014, 7:14:40 AM10/22/14
to django-d...@googlegroups.com
Uhm, I don't think you can ignore the callback, isn't the callback what's included in the response? As such for proper function the callback can't be ignored.

Cheers,
Florian
Reply all
Reply to author
Forward
0 new messages