Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#9707 closed feature (notabug)

No possibility to disable caching in autocomplete

Reported by: err1 Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

Hi i Wonder if my ticket will be read as an evolution request or as a bug... For my personnal use, the lack i met is a bug, and to fix it i had to modify the js code. The problem seems to be known : there is no possibility to disable the caching facility of ui.autocomplete, and in some case it generates problems... I use a database to provide the source of my autocompletion, excepting some of them. If the data i want to filter have been updated in the same Context / Session (i work with C# MVC3 IE9/10), the autocompletion continues to propose them... For now i'm ok, having added the "cache :false" in the ajax call of _initSource function... But i really think that a 'cache' parameter is necessary for the widget.

Thank you for you reading :-) err1

Change History (5)

comment:1 Changed 6 years ago by Scott González

Resolution: notabug
Status: newclosed

There is no cache built into the autocomplete widget.

comment:2 Changed 6 years ago by err1

Thank you for your answer, but it was exactly the point of my ticket : THERE SHOULD BE a cache parameter in autocomplete ! It uses ajax call, for which the cache parameter is (because of this lack) always true !

comment:3 Changed 6 years ago by Scott González

We're not going to add a cache option. There are a ton of different caching strategies. The need to not cache (at the ajax level) is pretty rare, and it's very easy to disable that when you need to.

comment:4 Changed 6 years ago by err1

i understand your point of view, but i disagree with you in 3 points :

  • when you need autocompletion on data that are updated in realtime, we have to offer the users the last version, no matter what.
  • jqueryUi, a such easy tool to use and to understand, should propose the easiest way to answer those problems. A newbye as i was (ok, as i am in so many points) need to focus in one tool and not to go and seek the Tools used by the first tool. _initSource uses Ajax, so you have to propose the ajax options, that's it. it's not the job of the developper to find how to disable globally the ajax option
  • as you said, sometime you need caching, sometime not. Disabling ajax caching for some fields and not for others is much more difficult than chosing an option in jqueryUi function, dont you think ?

Anyway, thank you for your answers :-) err1

Last edited 6 years ago by err1 (previous) (diff)

comment:5 in reply to:  4 Changed 6 years ago by Scott González

Replying to err1:

  • when you need autocompletion on data that are updated in realtime, we have to offer the users the last version, no matter what.

So don't let your server allow caching of that data.

  • jqueryUi, a such easy tool to use and to understand, should propose the easiest way to answer those problems. A newbye as i was (ok, as i am in so many points) need to focus in one tool and not to go and seek the Tools used by the first tool. _initSource uses Ajax, so you have to propose the ajax options, that's it. it's not the job of the developper to find how to disable globally the ajax option

There are plenty of demos showing how to use a custom source. It is absolutely the job of the developer to configure their tools to work the way they want.

  • as you said, sometime you need caching, sometime not. Disabling ajax caching for some fields and not for others is much more difficult than chosing an option in jqueryUi function, dont you think ?

Building something on your own is always more complicated than toggling a simple option. But toggling simple options is always complicated by the addition of new options. We absolutely will not provide an option for every possible use case. Go read http://blog.jqueryui.com/2011/03/api-redesigns-the-past-present-and-future/

Anyway, thank you for your answers :-)

You're welcome.

Note: See TracTickets for help on using tickets.