Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Emre Vona

    (@emrevona)

    you need to try exclude page feature for doing it.

    https://www.wpfastestcache.com/features/exclude-page/

    Thread Starter Beherit

    (@beherit)

    Are You kidding me?! One of my website have ~300 posts and ~420 pages so for each one I must set exclude – it’s imposible. Anyway, it’s simple to check when wp_redirect() is executed and do not cache page/post with redirect. And I don’t inderstand why Your plugin cache URLs where we have got 301 code!

    Thread Starter Beherit

    (@beherit)

    I feel very confused – I reported a bug and You just rid me off :/

    Plugin Author Emre Vona

    (@emrevona)

    My god ?? How can WPFC detect the redirection in htaccess? You can set the exclude rule and WPFC does not do anything about the page.

    Thread Starter Beherit

    (@beherit)

    This is not redirections in htaccess but via wp_redirect() function. And is not simple to set exclude rule – please write how can I exclude URLs without /pl/ and /en/ on start.

    Thread Starter Beherit

    (@beherit)

    And You are wrong, You can check that the site have redirect code and do not cache it.

    Plugin Author Emre Vona

    (@emrevona)

    ow now I got it. I did not read your explanation proplery, sorry. You use Ceceppa Multilingua for doing it. How does it redirect? Browser language?

    Thread Starter Beherit

    (@beherit)

    Yep, this plugin redirect by browser language via using wp_redirect() and custom slug.

    Thread Starter Beherit

    (@beherit)

    Any solution?

    Plugin Author Emre Vona

    (@emrevona)

    There is no solution. The plugin owner needs to make this plugin to be compatible with cache plugins. The static html file is created when the page is cached so php and mysql does not work. He needs to redirect the page with javascript instead of php.

    Thread Starter Beherit

    (@beherit)

    Thanks for answer but no such solution is expected. It is really simple to do fix on your plugin site – just check the page status before cache it. Such fix was in WP Super Cache. Optional You can hook on wp_redirect and check the source page and do not cache it.

    Plugin Author Emre Vona

    (@emrevona)

    If a page has been cached, how can I hook the function? If the page shouldn’t be cached, why do you use a cache plugin?

    Thread Starter Beherit

    (@beherit)

    Emre, this page have 302 code so it’s redirection. What is the sense to cache page with? Just tell me. I use a cache plugin to cache other page. What do you not understand?

    Thread Starter Beherit

    (@beherit)

    I created a simple fix, so don’t tell it is not possible to fix it (cache.php):

    public function callback($buffer){
    (...)
    }else if($this->checkHtml($buffer)){
    			}else if($this->checkHtml($buffer)){
    				return $buffer."<!-- html is corrupted -->";}
    			else if(http_response_code()!=200){
    				return $buffer."<!-- test -->";
    			}else{
    (...)

    I just add to function callback a checking of response code. Ofcourse there we can check only code 301, 302 etc.

    Thread Starter Beherit

    (@beherit)

    else if(http_response_code() == 301 || http_response_code() == 302){
    				return $buffer;
    			}

    This will be okey. Please add it to function callback in cache.php.

    P.S. You have a lot of white spaces in code ??

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Cache redirects?’ is closed to new replies.