WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] Start Page and Rejected User Agent (7 posts)

  1. dev2345
    Member
    Posted 3 years ago #

    Hi Donncha,

    I have mobile Support turned off, and rejected the iPhone User Agent. The Rewrite Rules are turned off(only wordpress active).

    But the WP Super Cache Plugin caches the Home Page of the site(via PHP). All other pages are shown correctly, without caching on the iPhone.

    Is this only mine, or a general Problem?

    Best Regards!

  2. dev2345
    Member
    Posted 3 years ago #

    Now all files of the rejected user Agent were cached by WPCache. This is what I got in the DEBUG-Logs:

    20:32:53 /permallink/to/post supercache dir: /srv/www/mydomain/wp-content/cache/supercache/www.mydomain.net/permallink/to/post/
    20:32:53 /permallink/to/post supercache dir: /srv/www/mydomain/wp-content/cache/supercache/www.mydomain.net/permallink/to/post/
    20:32:53 /permallink/to/post Served page from supercache file using PHP.
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 supercache dir: /srv/www/mydomain/wp-content/cache/supercache/www.mydomain.net/wp-content/plugins/wp-postviews/wp-postviews.php/
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 supercache dir: /srv/www/mydomain/wp-content/cache/supercache/www.mydomain.net/wp-content/plugins/wp-postviews/wp-postviews.php/
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 No wp-cache file exists. Must generate a new one.
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 In WP Cache Phase 2
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 Setting up WordPress actions
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 Supercache caching disabled. Only using wp-cache. Non empty GET request.
    20:32:55 /wp-content/plugins/wp-postviews/wp-postviews.php?_=1294605174943&postviews_id=157361 URI rejected. Not Caching

    First the WP-Cache Files are Files where I can see the mobile view, then the cached files are files where I can see the Desktop view.

    Can you explain me why the rejected User Agents are cached with WP Cache, and why I can stop that?

    And another general Question: When is the supercache used, when the WP-Cache?

  3. Donncha O Caoimh
    Member
    Posted 3 years ago #

    The rejected user agent field only stops pages from being cached by those browsers. Unfortunately it doesn't stop them being served to them.

    I am going to put a check in (when serving a cached page) but it won't work if you're using the mod_rewrite rules as PHP isn't run at all.

  4. Donncha O Caoimh
    Member
    Posted 3 years ago #

    Well, that wasn't too hard. Grab http://svn.wp-plugins.org/wp-super-cache/trunk/ossdl-cdn.php and place it in your Supercache plugin directory.

    You'll have to clear your cache to see the changes but it will now remember up to 30 urls (don't want it eating up all our memory) and serve repeating urls on that list from the same hostname.

  5. Donncha O Caoimh
    Member
    Posted 3 years ago #

    Oops, answered the wrong thread above.

  6. dev2345
    Member
    Posted 3 years ago #

    I'm using nginx as the webserver. The Mobile bowser are redirected directly to wordpress, an extra rule doesn't serve these via mod rewrite.

    The actual problem ist when I've rejected these user agent in supercache they will be cached with WP_Cache. I'm happy if you can modify this in a newer version.

  7. dev2345
    Member
    Posted 3 years ago #

    I solved the problem, i edited the $_SERVER['HTTP_HOST'], made a global variable and set in the config the host, what depends on the user agent.

    Then I wrote some special rewrite rules what redirect the specific user agents to the correct supercache Folder.

    But I've one question: I've seen that there were build some non supercache(wp-cache-xxxx.html) files in my wp-content/cache directory.

    What are these files, when were they build, because were they build shouldn't they are all supercache files?

    PS: YES, I've mobile support turned off :)

Topic Closed

This topic has been closed to new replies.

About this Topic