Thread Starter
b-cat
(@b-cat)
[ Update ]
I queried the IQ Block Country (IQBC) plugin support forum regarding this plugin conflict, and the IQBC plugin author responded that IQBC already does send out the “DO NOT CACHE” header instruction, which should be respected by caching plugins like WP Super Cache.
Does WPSC not scan for other plugins’ requests that pages not be cached? This seems like a very important feature to include in WPSC. Maybe it is already there, but I don’t see the options in the WPSC settings.
Any advice?
Fyi, you can read the IQBC plugin response to this issue here:
http://wordpress.org/support/topic/how-to-set-do-not-cache-option
Hi b-cat
I’ve just added a Country caching for WPSC plugin on WordPress.org It enables WPSC to cache by page + country instead of just page. It should provide a solution to country GEOIP/caching problems for most(?) plugins.
I’ve done a vey brief test using WPSC and IQ BC; blocking my home GB and then using a US proxy, IQ block county and WPSC worked together no problem displaying (or not) pages as per IQ settings.
N.B. if this plugin does what you need, then configuring WPSC to use a custom folder for its add-ons is recommended; as explained in the country caching documentation
Thread Starter
b-cat
(@b-cat)
Hey, thanks for the reply and for the efforts to fix this issue!
However, I’ve given the new plugin (CC4WPSC) a try, and while it may be a good solution for others, I don’t think it will be ideal in my case.
To use CC4WPSC in tandem with IQBC, I will need to block all the countries I want to block in IQBC (and fyi, I’m blocking virtually every country in the world except the U.S.), and manually type in all the countries I’m blocking in your “do not cache” field in the CC4WPSC settings page.
That’s just too much manual effort, since I’m also likely to change the countries that are blocked periodically. Also, the CC4WPSC forces WPSC to use “legacy caching,” which is slower than using mod_rewrite, etc., which my service provider virtually requires (plus it’s just good practice when it’s do-able).
The ideal solution would be for WPSC to simply somehow see the “do not cache” instruction that IQBC (and probably other plugins) place in the headers, and then those pages would not be cached.
But…this is a great effort and I applaud it. It may be a perfect solution for other WP users. Thanks!
Thread Starter
b-cat
(@b-cat)
One other thought…
I noticed that in the WPSC Settings page > Advanced tab there is a notification that reads:
“DO NOT CACHE PAGE secret key: *******”
Is there a way that I can add this key to one of IQBC’s operating files so that IQBC will automatically submit that key with any “blocked” pages that it generates so that WPSC won’t cache them?
That would appear to be the point of the secret key, but I’m not clear on how to use it.
Any suggestions?
Hi b-cat,
I may be missing something, but I think you’ve misunderstood how CC4SC works, I’ll modify documentation to explain it.
You don’t need to specify countries for it to work with IQBC (but doing so has advantages, and you would only have to specify the FEW valid countries). N.B. CC4SC’s country option is a “separately cache” not a “do not cache” option (see explanation below).
As is, WPSC stores a snapshot for each page. Simplisticly, page cache is stored as “WPSC/somepage” and “WPSC/anotherpage” etc. If the first visitor to “somepage” was blocked subsequent legitimate visitors will be served the “blocked” cache.
CC4SC enables WPSC to store and serve pages based on page PLUS visitor country e.g. snapshots are stored as “WPSC/somepage-FR” “WPSC/somepage-US“.
These will contain the correct “blocked” or “allowed” content for visitors from that country.
Using CC4SC Country Codes option minimises the number of snapshots stored. It enables WPSC to use “shared” cache for most countries (e.g. those disallowed) but separate cache for the countries you have specified. e.g. if IQBC only allows visitors from US and Canada then set CC4SC to “separately cache” US,CA.
Now, when “somepage” is requested by these visitors the “allowed” page cache will be stored and served from “WPSC/somepage-US” or “WPSC/somepage-CA“. All other visitors will see the “standard” “WPSC/somepage” (without country code) cache; this will have been created by the first non US/CA visitor and be a “blocked” snapshot.
If you do use CC4SC’s country option clear WPSC cache first.
You are spot on in your comments on legacy caching. However, I think impact on most sites using Legacy option instead of the other WPSC caching options will be negligible (Donncha advises use of Legacy caching for problem fixes in this forum; and his article for plugin developers does not warn/highlight a performance hit when using required legacy caching).
Thanks for the feedback
Thread Starter
b-cat
(@b-cat)
Thanks for this info. Very helpgul.
However, this still feels overly complicated to me. So, in the country blocking plugin one must specify which countries to block, and then in WPSC one must specify which countries will NOT be blocked so that WPSC can create a separate cache just for those countries.
As soon as I make any changes to the country blocking plugin, I must also simultaneously go over to WPSC and make the corresponding reverse changes to WPSC.
If I’m only blocking one or two countries in the country blocking plugin, I must then specify (by hand typing, no less) in WPSC the remaining HUNDREDS of other countries that I want to cache separately.
Wouldn’t the simplest solution be for WPSC to read and follow the “Do Not Cache” headers generated by other plugins. IQBC generates a “Do Not Cache” header (according to that plugin’s author), but it seems to have no effect within WPSC.
I see that WPSC includes on the Advanced tab a “DO NOT CACHE PAGE secret key”. What is the purpose of this? Can I place this key somewhere in another plugin’s config files to ensure that WPSC will not cache the other plugin’s generated html?