• Resolved dos659

    (@dos659)


    hi, im loading a specific .php file inside my products pages. Is it possible to exclude that particular file from caching?

    This .php file contains prices that are updating regularly and instead of clearing the cache all the time i want to exclude only this so the customers will always see the up to date price.

    thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @dos659 Comet Cache is a WordPress plugin designed to cache WordPress Posts/Pages. If you have custom PHP code that you’re including inside a WordPress Post/Page, and you need to prevent that from being cached, you should simply exclude the URI where that PHP code is being included (e.g., add /prices/ to Comet Cache → Plugin Options → URI Exclusion Patterns).

    Thread Starter dos659

    (@dos659)

    So if my file is xxx.php is inside wp-content i exclude this URI:

    http://www.example.com/wp-content/xxx.php

    is that correct?

    @dos659 Comet Cache is a WordPress plugin that loads when WordPress is loaded. It doesn’t know about /wp-content/xxx.php, so it won’t be able to exclude that.

    If you’re doing something like <?php include(WP_CONTENT_DIR.'/xxx.php'); ?> inside a WordPress Page that has a permalink of http://www.example.com/sample-page/, then you would need to add /sample-page/ to the Comet Cache URI Exclusion Patterns to prevent /sample-page/ (and therefore your xxx.php code) from being cached.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘exclude a .php file from caching’ is closed to new replies.