croxton / Wires

Wire up your forms to URI segments. Search, filter sort and order entries with clean, readable uris.
7 stars 1 forks source link

page cache #4

Open robsonsobral opened 8 years ago

robsonsobral commented 8 years ago

Hi, Mark.

Is there a way to allow us to use page caching with wires? Can you imagine one? The only idea it came to my mind is to point the submit to an ACT url, which requires a pull request.

What do you think?

croxton commented 8 years ago

Wires generates unique URLs so you can static-cache the pages and make sure your htaccess only serves the static-cached page for GET requests, as it would with this .htaccess: https://github.com/croxton/Stash/wiki/Static-cache-setup

However:

What I tend to do: static cache the main landing pages of your search only. These get the greatest traffic, and present the best use of full-page caching.

For example: http://www.vennershipley.co.uk/resources Once you begin to search, pages are dynamic.

robsonsobral commented 8 years ago

I'm using the native page caching at the moment.

I just had an idea. I'm testing to point the action parameter to a template with only the exp:wires:connect. All parameters and no content. This way, the wires URL can do the redirect.

{exp:wires:connect
    url="/busca/{start_year}{start_month}{start_day}/{end_year}{end_month}{end_day}/{age_group}/{what}/{where}?palavra-chave={palavra-chave}"
    action="/busca/executar"
    form="no"
    parse="inward"
    id="advanced-search"
    prefix="wires"
[...]
}
{/exp:wires:connect}

I still don't know if the native page cache considers the query strings.