WP Super Cache plugin only wp-cache URLs with query strings but does not super cache. See attached screenshot.
There is a difference between WP-Cache and Super Cache which is WP-Cache still invokes PHP while Super Cache bypasses everything and simply serves a static HTML file for fastest performance. There is an explanation about this at the 2nd and 3rd paragraph.
I would like to super cache a specific URL type with query string which is:
http://www.raymond.cc/blog/download/?did=XX (Replace XX with incremental numbers)
Hey Raymond, have you tried the other way round, to rewrite the url to get rid of
the GET parameter?
http://www.raymond.cc/blog/download/did/19 => http://www.raymond.cc/blog/download/?did=19
where the rewrite rule would be something like:
RewriteRule ^blog/download/did/([^/]*)$ /blog/download/?did=$1 [L]
You can also consider
add_rewrite_endpoint( 'did', EP_PAGES );
add_action( 'init', 'custom_endpoint' );
or something like this
// you can adjust this to your needs:
add_action( 'init', 'custom_rewrite' );
if your page name is <em>download</em>.
Then to access the <em>did</em> variable in your template, you'll need:
function custom_query_vars( $query_vars )
$query_vars = 'did';
add_filter( 'query_vars', 'custom_query_vars' );
You will have to remember re-save the permalinks settings.
Thanks for the redirect suggestion. I believe this will work but I'm trying to avoid this workaround because there is still have a lot of redirects that Google haven't fully transfer to the new location. (That is a different problem...)
Someone seems to have managed to modify WP Super Cache to super cache query strings urls but I have not given it a try. I think the moded plugin caches all query strings but I prefer to just super cache url with query string "?did=XX".
Can you check?
Here is the <em>diff</em> between wp-super-cache (0.9.9.8) and wp-super-cache-getmod
You think that would work?
I believe that modded version will super cache all query strings url if it worked?
I found these explanations from the mod-author:
<blockquote>My modified version simply throws away any GET variables in the request, it's up to the reader to setup the theme to use ajax to parse any necessary dynamic content from the GET string. This helps to further reduce overhead since in the stock version any url with a query string is never cached.</blockquote>
ps: I wonder if you have tested W3TC?
It seems to have this setting:
Cache URIs with query string variables
I wonder if it's what you need?
I used W3TC many years back and some of the features didn't work properly with my dedicated server.
Tried WP Super Cache and everything works quite nicely.
Do you think you can modify the modded version a little bit to only cache urls with query strings did=XX?
I've applied the changes from the modded WP Super Cache to the current 1.4 and the URL with query strings are still being wp-cached and not super cached.
Is this task impossible? Or the offered price too low?
which plugin is creating pages with permalink structure http://www.raymond.cc/blog/download/?did=XX ? (want to know for testing )
wp-super cache already does not support http://www.raymond.cc/blog/?p=123 type permalink structure .
I'm using Download Monitor plugin, 18.104.22.168 legacy version.
The latest "rewritten" version no longer uses query string but due to a lot of code modification is done on the installed Download Monitor plugin, I think it'll be more work to upgrade to the latest version and merge all the changes to it.
Francisco Javier Carazo Gil answers:
Instead of using WP Super Cache in this cases I prefer Varnish directly. Much more efficent and much more powerful.
I'm running LiteSpeed Enterprise which already has caching feature but I prefer something that's easier to manage which is why I opted for WP Super Cache.
Francisco Javier Carazo Gil comments:
At the end, Varnish is so easy as it because you can directly manage it via plugin and there are many VCL in the net to adjust anything (although a typical configuration should be enough).