Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete Cache Persistence Issue: Same autocomplete result returned despite parameter changes #24

Open
LukasWalterAceArt opened this issue Jan 25, 2024 · 0 comments

Comments

@LukasWalterAceArt
Copy link

Description:
Currently, we're encountering an issue with the autocomplete functionality where the Ajax calls are being cached, resulting in the same result being displayed every time. Despite changing the parameters, the first result for the autocomplete is cached and consistently returned with each subsequent call. This behavior occurs despite the action being registered as non-cachable and the inclusion of the "noCache" parameter.

This issue also occurs on the example sites provided by this repo.

Steps to Reproduce:

  1. Navigate to the autocomplete search field.
  2. Enter a search query.
  3. Observe that the autocomplete results remain the same even for different queries.

Expected Behavior:
The autocomplete results should reflect the current search query and not be affected by caching.

Additional Information:
We've attempted to resolve this issue by ensuring that the action is properly registered as non-cachable and by including the "noCache" parameter. However, the issue persists.

Proposed Solution:
After further investigation, we found that adding no_cache = 1 in the Setup.typoscript file of the Extension resolves the issue. Here's the modified snippet:

search = PAGE
search {
    typeNum = 7423794
    config {
        disableAllHeaderCode = 1
        additionalHeaders = Content-type:text/html
        xhtml_cleaning = 0
        debug = 0
        admPanel = 0
        no_cache = 1
    }

    10 = COA_INT
    10 < tt_content.list.20.indexedsearchautocomplete_search
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant