Minnur.
I was looking for my cache issues today, and could not solve it without disabling the caching.
So open an issue, perhaps somebody else has same setup or any hints regarding this.
Problem:
We are using memcache on the live server, which seems to make troubles with the ads redirect.
It always works 1 time, then you will just receive the node with the title "Redirect Ads".
When I clear cache, it will work for 1 time again, then it fails back to the redirect ads node page.
I see some different things but not yet sure how to fix this.
Its also something between a cache problem and the way we call the redirection in this module. Perhaps this is the problem.
Possible solutions?:
Disabling caching will solve the problem -> not nice idea :)
Extend the "header()"-redirect with some javascript or other ways to redirect
Find a way to not cache this pages, but I didn't could solve this with this memcache setup
I will try to use some javascript or similar for a workaround, lets see...
Regards Cyclodex
Comment | File | Size | Author |
---|---|---|---|
#9 | prevent_redirect_caching-1555988-9.patch | 605 bytes | Angry Dan |
Comments
Comment #1
minnur CreditAttribution: minnur commentedHi have you tried this module? http://drupal.org/project/cacheexclude
Comment #2
Cyclodex CreditAttribution: Cyclodex commentedYes but it looks like this can not influence the state, perhaps because I read that you have to set this var:
$conf['page_cache_invoke_hooks'] = false;
No idea, its a bit a complex material for me :)
Now I am also trying to use some other redirects, but somehow when used with the remote tracking url it still failes. Funny is, when I refresh the page then, it redirects... strange.
Some different redirects i am testing :
Perhaps still some mistakes in my code...
Comment #3
minnur CreditAttribution: minnur commentedDo you also use Varnish ? If yes you could try to exclude the following path from caching:
simpleads/redirect/*
simpleads/load/*/*
Comment #4
Cyclodex CreditAttribution: Cyclodex commentedYea also using varnish but this one is related to memcache, because our office is ignored by varnish.
Anyway asked our hosting provider to exclude this from the varnish.
I have no clue what goes wrong finally, it is a bit strange, but this code here, makes the redirect working fine without any cache change. The things I tried above seems not really working all the times.
Here I have now a final fallback, with javascript if the header stuff is not working.
Looks fine now, not sure if we want to apply this patch to your module? Please test it for your setup or give me a comment what you think about it:
We could improve it further, make the URL in the message also a link etc.
Just want to hear your feedback first. And I don't know yet how to provide a patch, I will have to read up how that should be done correctly.
Comment #5
minnur CreditAttribution: minnur commentedHi Cyclodex,
Thanks for the code. I will review it, this is more like workaround.
We are launching the site on server Varnish+memcached very soon and most likely we will get this problem too.
I will try to come up with some solution (maybe I will implement my own hook that will alter default redirection behavior) so it will be alterable without actually hacking the SimpleAds module.
Thanks,
Minnur
Comment #6
minnur CreditAttribution: minnur commentedHi Cyclodex,
I just added a new hook, please get the latest code from GIT.
hook_simpleads_redirect($url, $delta);
Here is how to use your code with SimpleAds:
Please use the following variable to set the delta:
variable_set('simpleads_redirect_delta', 'YOUR_DELTA');
Thanks
Comment #7
minnur CreditAttribution: minnur commentedFYI, I just release SimpleAds version 7.x-1.8.
Comment #8
Cyclodex CreditAttribution: Cyclodex commentedThanks minnur!
Great to use this hook.
I wanted to update your code and it looks ok ,but the only problem I see is, the Ads I already have setup are now all empty... They just loosed their data somehow.
Can you try out if that also happens for you?
When I create a new one, it looks ok
But is there a problem/bug or why are my old Ads not complete anymore ?
They just have the title and language selected, but no ad group, active date, image or other settings...
Strange, I don't see any code change which could made this problems.
Hmm otherwise I will just recreate them...
Comment #9
Angry Dan CreditAttribution: Angry Dan commentedRather than using a hook to pass out the cache circumvention work to a custom module, would it not be better to always disable caching on the redirect pages? This would also ensure that clicks are properly registered.
See attached patch, I think this should resolve the issue.
Comment #10
minnur CreditAttribution: minnur commented@Cyclodex, any updates ? Were you able to identify the problem with the update ?
Thanks
Comment #11
Cyclodex CreditAttribution: Cyclodex commentedHey
Did not know this option, but hope this works fine :)
I also implemented this option but I think I still left my fallbacks in for the moment.
Because we only have this setup on "live"-platform I can't make any tests so. And because we don't want to break the counts on the already implemented ads I can't do for the moment.
Would have to need some more time to test and have a look why this all happens. Sorry
Just having to much other project tasks to do :-/
Nobody else using this memcache with SimpleAds?
Comment #12
MrPeanut CreditAttribution: MrPeanut commentedI've noticed this issue with SimpleAds using Boost. I had to disable Boost for now, but may try excluding the simpleads/redirect paths.
I may also try Ajax Blocks.
Comment #13
minnur CreditAttribution: minnur commentedComment #14
21tech CreditAttribution: 21tech commentedI am using boost and simply disable the cache on simpleads/* pages and all seems to be fine.
I do not remember if block caching stops rotation, but if it does I would recommend block_cache_alter module.
Comment #15
cimo75 CreditAttribution: cimo75 commentedHi I had to enable the cacheexclude module to get simpleads to show properly, otherwise they would randomly appear, disappear.
Now I ve found out that simpleads will show up only on mydomain.com and not in www.mydomain.com, how can i fix that? For the moment I ll force a redirect to my domian without www prefix.
Simone
Comment #16
johnnybgoode CreditAttribution: johnnybgoode commentedI was having problems with the redirect page being cached when switching between http and https, and can confirm that the patch in #9 worked for me.
Comment #17
minnur CreditAttribution: minnur commentedPlease try to add this function to page callback: http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupa...
Comment #18
minnur CreditAttribution: minnur commentedI disabled caching in simpleads/redirect/* paths . Please download dev version and test.
Thanks!
Comment #19
Angry Dan CreditAttribution: Angry Dan commentedWow, that's even cooler, I hadn't seen that function before.
Will use that in future
Comment #20
tmsimont CreditAttribution: tmsimont commentedthanks @minnur -- adding
drupal_page_is_cacheable(FALSE);
looks like it did the trick.Comment #21
Pete B CreditAttribution: Pete B commentedI have confirmed this solution too. Can we get a stable release please?
Comment #22
josean CreditAttribution: josean commentedI also confirm, #9 patch from Angry Dan works in my site, running 7.x-1.8.
Many thanks!
Comment #23
david_garcia CreditAttribution: david_garcia commentedI also confirm, #9 patch from Angry Dan works in my site.
Many thanks!
Comment #24
mrmikedewolf CreditAttribution: mrmikedewolf commentedFor anyone stuck on simpleads v. 7.x-1.7, here is a version of the patch from #9 that they can use.
I mistakenly put the wrong version in the dropdown for version so this may fail testing. It is for 7.x-1.7.
Comment #26
mrmikedewolf CreditAttribution: mrmikedewolf commentedHere is a patch for 7.x-1.7 that implements minnur's fix from #17.
Comment #27
Clint Eagar CreditAttribution: Clint Eagar commentedConfirming #9 works for me, using Simpleads D7 1.8 and Xcache.
Comment #28
skyredwangPatch should be always agaisnt HEAD
Comment #29
Dimm CreditAttribution: Dimm commentedBoost+SimpleAds 7.x-1.8 = redirect problem.
I disabled caching in simpleads/redirect/* paths .
And uncheck admin/config/system/boost/debug
"Send debug info for each request to watchdog."
OK!!!
Comment #30
nicxvan CreditAttribution: nicxvan commented#9 worked for me in 1.8
Comment #31
nicxvan CreditAttribution: nicxvan commentedCan we get this committed?
Comment #32
aharown07 CreditAttribution: aharown07 commentedoops
Comment #33
aharown07 CreditAttribution: aharown07 commentedThis appears to be fixed in 1.9. I was seeing the issue in 1.8 but not at all since going to 1.9
Comment #34
JordanMagnuson CreditAttribution: JordanMagnuson commentedYes, this is fixed in 1.9.