dotcompixel.com Posted April 16, 2015 Share Posted April 16, 2015 Hi, I need your help. I need to disable caching for payment validation page. I add for each payment method custom code which control if customer select some custom input. The problem is when customer doesn't select some value and on payment validation I show him error and hide button for order confirmation then customer select some value but because of caching there is still error even thought this error is not valid because customer already selected some value. When customer refresh page with F5 then error disappear and everything works. So I need to disable caching on payment validation page because I need to show on this page real data not cached data. It is possible to do it? I hope that I describe my problem well if you do not understand please tell me it I will try to describe it again. Thanks for your help. Michal Link to comment Share on other sites More sharing options...
cristic Posted April 16, 2015 Share Posted April 16, 2015 Are you sure this is a caching problem? What happens if you completely disable caching from BO? Is it working then? Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 17, 2015 Author Share Posted April 17, 2015 I already disabled caching but if you disable caching in BO presta is still caching. I know that this is problem with cache because I find payment confirmation page in /cache folder. And for example if I add var_dump into bankwire code this var_dump if not showing when I come to payment confirmation page again but when I refresh page with F5 then I see var_dump. I do not understand why Prestashop is caching page If I have all cache in BO disabled. Link to comment Share on other sites More sharing options...
PascalVG Posted April 18, 2015 Share Posted April 18, 2015 What payment module do you use? Maybe the module is a little 'rogue' and doesn't look at settings for yes/no caching or so. Maybe check the files in the /modules/<your payment module name> for any caching going on... My 2 cents, pascal. Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 19, 2015 Author Share Posted April 19, 2015 It doesn't matter which payment module I am using because the problem is with default bankwire prestashop module and also with default cash on delivery module. Each of these modules are still caching into cache/smarty/compile folder. If I manually delete this folder then I get right var_dump but for example If I delete cache folder add into validation.php payment controller var_dump('true') and go to /index.php?fc=module&module=cashonpickup&controller=validation I get right var_dump but when I edit var_dump into var_dump('false') and again go to: /index.php?fc=module&module=cashonpickup&controller=validation I get the answer var_dump('true') which is wrong because I edited it. When I refresh page with F5 then is shows var_dump('false') but without F5 refresh payment validation page still show wrong answer. I try to check everything but I am not able to disable caching it is really frustrating because caching system in Prestashop is really bad work I have to say. Because I have second experience with caching and it is that when I enable file caching shop is loading around 5 second slowly then with disabled caching so my question is why Prestashop do this. I like using Prestashop but this is really frustrating. If someone can help my I will by very grateful to him. Thanks Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 19, 2015 Author Share Posted April 19, 2015 I finally solved it. I just add into index.php this code: header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now