Menu icon Foundation
Modal Reveal, Caching AJAX response

Hi all,

I would like to know if it's possible to cache the AJAX request to make only one request ?

On my website, I put the login and register into a modal (like Airbnb). But with each click, a new request is made to load the content in the modal. On Airbnb (they not used Foundation), a first request load the content of the modal, and other requests (if you close and reopen the modal) are caching, no more requests has lunched.

Do you have an idea ?

I have try to set a callback on the "open.fndtn.reveal" event, but I can't prevent the event to not make the ajax request.

Thanks you !

modalAJAXcacherevealrequestresponseevent

Hi all,

I would like to know if it's possible to cache the AJAX request to make only one request ?

On my website, I put the login and register into a modal (like Airbnb). But with each click, a new request is made to load the content in the modal. On Airbnb (they not used Foundation), a first request load the content of the modal, and other requests (if you close and reopen the modal) are caching, no more requests has lunched.

Do you have an idea ?

I have try to set a callback on the "open.fndtn.reveal" event, but I can't prevent the event to not make the ajax request.

Thanks you !

This post has been closed. No new replies can be added.

Wolfgang Pommier about 4 years ago

Finaly I have find the solution ! :D

Depends on your code, you must first open the modal with the url param, and for the others opens, just open the modal without the url param.

Bye.