Title: ajax cach
Last modified: December 12, 2020

---

# ajax cach

 *  Resolved [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/ajax-cach/)
 * Hi
    on my site for logging, the user has to click a button. a modal window appears.
   after that users have to click to the login button. it works with ajax. for some
   user the modal windows become freeze. can I stop caching ajax?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/ajax-cach/#post-13783274)
 * Hi,
 * ajax doesn’t get cached , you can verify it by HTTP response header, for any 
   ajax call you should see “x-litespeed-cache-control: no-cache” on it.
 * when it freezes, do you see any error message ? what is the status code on that
   ajax request ? this is more like nonce issue.
 * Best regards,
 *  Thread Starter [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/ajax-cach/#post-13786411)
 * I use this code after successful login
 *     ```
       response = JSON.parse(response);
   
                       if(response.status == 'success'){
                           formSuccessArea.html(response.message);
   
                          location.reload();
                       }
       ```
   
 * it just reloads the page and doesn’t log in!
    I change to location.replace(‘/
   profile’); I realize when the plugin is active replace method after login does
   not work. but as soon as disable the plugin. users after logging redirects to
   profile page.
 * by the way the result of console.log(currentAjax.getAllResponseHeaders()) is
 *     ```
       access-control-allow-credentials: true
   
       access-control-allow-origin: https://www.my.com
   
       cache-control: no-cache, must-revalidate, max-age=0
   
       content-encoding: br
   
       content-length: 125
   
       content-type: text/html; charset=UTF-8
   
       date: Mon, 14 Dec 2020 13:23:29 GMT
   
       expires: Wed, 11 Jan 1984 05:00:00 GMT
   
       referrer-policy: strict-origin-when-cross-origin
   
       server: LiteSpeed
   
       vary: Accept-Encoding
   
       x-content-type-options: nosniff
   
       x-firefox-spdy: h2
   
       x-frame-options: SAMEORIGIN
   
       x-litespeed-cache-control: no-cache
   
       x-robots-tag: noindex
       ```
   
    -  This reply was modified 5 years, 4 months ago by [RezaY](https://wordpress.org/support/users/mohammad983/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/ajax-cach/#post-13789356)
 * Hi,
 * when you successfully logged in , did you see , by dev tool , **_lscache_vary**
   cookie being sent/set ?
 * x-litespeed-cache-control: no-cache —> this shows that request is not being cached.
 * > I change to location.replace(‘/profile’);
   >  I realize when the plugin is active
   > replace method after login does not work. but as soon as disable the plugin.
   > users after logging redirects to profile page
 * I think might be the JS code is being cached
 * could you please try login_redirect hook and see how that goes ?
 * Best regards,
 *  Thread Starter [RezaY](https://wordpress.org/support/users/mohammad983/)
 * (@mohammad983)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/ajax-cach/#post-13790432)
 * login_redirect hook works. thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘ajax cach’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [RezaY](https://wordpress.org/support/users/mohammad983/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/ajax-cach/#post-13790432)
 * Status: resolved