• Resolved Ibrahim Turan

    (@ibrahim-turan)


    I want to use a caching plugin (any can do, WP Fastest Cache seems like a good choice).

    What I want is that the plugin handles AJAX calls as normal pages, so that for each call, a file with the response is saved to disk (and added to .htaccess).
    When the next time a user requests the same AJAX filtering (because that’s what I’m using it for right now); the server will serve the static html file saved from cache.

    It requires from my knowledge:
    1. handling AJAX calls as pages, thus making it possible to cache the full html
    2. using the AJAX call parameters (per ex. filtering, or sorting; like Color=blue, Price=Asc) for the different pages (e.g. the different html files
    3. adding to .htaccess to intercept client ajax requests and serve the static html instead

    Is such thing possible?

    https://wordpress.org/plugins/wp-fastest-cache/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Emre Vona

    (@emrevona)

    If url has query string (e.g. /index.php?action=something&id=3), the url is not cached so I don’t think that what you expect is not possible in WPFC.

    Thread Starter Ibrahim Turan

    (@ibrahim-turan)

    Is it possible at all?

    I mean technically speaking, can we build something that does this?

    Thread Starter Ibrahim Turan

    (@ibrahim-turan)

    Plugin author responded:

    You should remove the line below from htaccess.
    RewriteCond %{QUERY_STRING} !.+

    Plugin Author Emre Vona

    (@emrevona)

    RewriteCond %{QUERY_STRING} !.+

    This line prevents the url is served via cache if the url has query string like that /file.php?color=red&key=value

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Serve static HTML files for AJAX requests’ is closed to new replies.