Git Product home page Git Product logo

pj-page-cache-red's People

Contributors

bookt-jacob avatar erikdemarco avatar pj-dave avatar soulseekah avatar zlmitche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pj-page-cache-red's Issues

Enhancement: Compression type and level support

Hi!

Would it make any sense to support different compression levels for zlib? Default is 6, but perhaps 1 would be faster?

Also, I think zstd (levels 1-5) or lz4 would be a better choice of compression. Much much faster than zlib.

Enhancement: Persistent connection support

Please add a support for persistent connection, so instead using:
$redis->connect
we use
$redis->pconnect

Using persistent connection will not reinitialize redis driver on each request
So It will be faster.

Plugin Optimization...

Currently our plugin doing the cache clearing ourself (on shutdown). And when we want to get cache we get multiple keys (real value and locked value).

All of this makes redis not useful. For what we do all of this if redis already do that? Redis have LFU which is much more smart when deleting expired cache. We just need to pass ttl when setting the cache. And redis will take care of the rest.

For locking the key it still make sense. But we can optimize it by implementing redis way using either Redlock / SETNX / WATCH.
For deleting expired cache let redis do it.

When we compare our plugin with other similar page cache plugin (using redis) like WP Redis Cache. We left behind so much:
=> https://github.com/BenjaminAdams/wp-redis-cache

Then when comparing with disk cache, we even get similar result (redis is reading from ram, logically it should be much much much faster then reading from disk)

Now the benchmark: (100visits/sec for 10 minutes)
W3 Total Cache (disk basic cache): avg 365ms
Pressijitsu redis cache (localhost): avg 368 ms
WP redis cache (localhost): avg 41ms

Incorrect path

Hi,

In the instructions

ln -s plugins/redis-page-cache/advanced-cache.php advanced-cache.php

should be

ln -s plugins/pj-page-cache-red/advanced-cache.php advanced-cache.php

url with trailing cash are not being cached

Hello,
let's take for example the url (article post) https://domain.com/hello-world

  1. for https://domain.com/hello-world, x-pj-cache-status: hit

  2. for https://domain.com/hello-world/, x-pj-cache-status: miss

why is that

How to differentiate cache for mobile users?

Hello,

Using your cache system for a week or 2 and really enjoy it, but one question remains, as the title of this issue stated...

I tried to had this line to the $request_hash variable: 'user-agent' => ! empty( S_SERVER['HTTP_USER_AGENT'] ) ? S_SERVER['HTTP_USER_AGENT'] : '' (I know it should generate a lot of db rows for a single page, but it's a temporary hack so...), but it did not seems to work as expected...

What do you think of this?

Cache is always missed

curl -v http://tide.local/ -o /dev/null
*   Trying 127.0.0.1...
* TCP_NODELAY set
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:05 --:--:--     0* Connected to tide.local (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> Host: tide.local
> User-Agent: curl/7.50.3
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 20 Apr 2018 06:37:48 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Powered-By: PHP/7.2.4
< X-Pj-Cache-Status: miss
< 
{ [16148 bytes data]
100 16142    0 16142    0     0   3131      0 --:--:--  0:00:05 --:--:--  104k* Curl_http_done: called premature == 0
100 54281    0 54281    0     0  10529      0 --:--:--  0:00:05 --:--:--  351k
* Connection #0 to host tide.local left intact

Any ideas on what to try based on the message I keep getting back from the curl request?

Ignore `wp-settings-*` cookies

When users logout they'll still see different cache buckets due to the uniqueness of some wp-settings-* cookies used only in the admin panel. We can safely ignore these cookies to increase the cache hit-rate for users that may have been logged in at some point.

Ignore Partial Cookie Names

Do you have any advise how partial cookie names could be ignored?

Piwik and Iubenda use such (e.g., _pk_id.1.ee8a, and _iub_cs-819208 accordingly). In these cases, only the prefix should be selected.

Missing function

I'm not sure where the pj_sapi_headers_clean() function is suppose to be coming from, it definitely doesn't exist in the plugin. However, it's being referenced in two places pj-page-cache.php#L146 & pj-page-cache.php#L162. Could you explain what the function does and how to get it?

Cache is only hit on second call

Hello,

First of all thanks for this really cool caching plugin for Wordpress!

I'm facing a weird behavior on a website using AWS Beanstalk and Elasticache (Redis version of course) as the hit is only showing up on the second refresh of the same page...

Does it sounds like a bug or a misconfiguration for you?

Thanks for any tip and/or trick about that...

Fragment Cache/Hole Punching/using it for Woocommerce

Hey,

have you thought about adding a Fragment Cache/Hole Punch capability?
I'm think of building a fragment cache solution so it can be used with (more) dyamic webshops based on woocommerce too (whereby we take the Fragment Cache capiability/Fragment marker from W3TC).

Do you have any plans for this? (so there might not be duplicate work)

Composer support

Hi guys,

Thanks for the excellent drop-in, could you please add composer support?

Thanks,
E

No longer caching in Wordpress 4.9+

I upgraded my server from PHP 5.6 to PHP 7.2, and its no longer caching via Redis. I checked, and it is requesting the page from Redis, but its no longer sending the cached page to Redis.

Any ideas?

redis-page-cache-config.php doesn't seem to work

Might have misunderstood but I placed redis-page-cache-config.php in WP root (not /wp-content) and added the_a few variables. All that happens is that the variables are displayed in text at the top of the website.

Handle `wordpress_test_cookie` better

Sometimes due to a cache hit, the wordpress_test_cookie cookie on wp-login.php is not set, causing a failure when attempting to login for the first time.

Setting TTL in Redis

It looks like there's a TTL setting available for this plugin, but it's only used for internal calculations. There is no TTL passed to Redis, so each page is cached indefinitely. That seems to be why the allkeys-lru eviction policy is recommended.

With our current automation, we're not able to easily change this eviction strategy from the default, which does not evict any keys that do not have a TTL set. Is there any reason that this plugin couldn't optionally set the TTL in Redis?

Clear cache on specific URL

Hello.
How can I clear/disable the cache on a specific URL?
Is it possible in functions.php for instance?
Thanks in advance.

Modify cache before page loads

Hi,
I want to modify only a part of the html of a page when I consider it's expired and store the result html in cache.
Is there a hook or something to check cached html and edit it before page loads?

Thanks

video not be cached and not play

Hello

On our multisite, I am tracing the issue of video not playing in Safari After wildcard SSL setup.

Here is a video for your test,

https://lovcour.com/testvideo/testvideo.hyperesources/mp4_video.mp4
which I uploaded by ftp, that means the issue is not related to wordpress.

Here is the screenshot in Safari Console, and it show video is not cached:

http://prntscr.com/jgtcf0

and here is cache setting in redis-hhvm.conf

cat /etc/nginx/common/redis-hhvm.conf

Redis NGINX CONFIGURATION

DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee)

set $skip_cache 0;

POST requests and URL with a query string should always go to php

if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != “”) {
set $skip_cache 1;
}

Don’t cache URL containing the following segments

if ($request_uri ~* “(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|/feed/|sitemap(index)?.xml|[a-z0-9-]+-sitemap([0-9]+)?.xml)”) {
set $skip_cache 1;
}

Don’t cache URL containing the following segments (BuddyPress)

#if ($request_uri ~* “(/forums/|/groups/|/members/|/activity|/blogs/|/messages/|/register/|/activate/|/bpactivity/|/bp-portfolio-projects/|/bpgroup/|/activities/|/bp-social-articles.*|/bpmember/)”) {
if ($request_uri ~* “(/bpmember/)”) {
set $skip_cache 1;
}

if ($request_uri ~* “(/lovcourshow/|/ishsow/)”){
set $skip_cache 1;
}

if ($request_uri ~* “(/wechat-authorize-remote.php)”) {
set $skip_cache 1;
}
if ($request_uri ~* “(/cross-domain.php)”) {
set $skip_cache 1;
}

Don’t use the cache for logged in users or recent commenter or customer with items in cart

if ($http_cookie ~* “comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart”) {
set $skip_cache 1;
}

Use cached or actual file if they exists, Otherwise pass request to WordPress

location / {
try_files $uri $uri/ /index.php?$args;
}

location /redis-fetch {
internal ;
set $redis_key $args;
redis_pass redis;
}
location /redis-store {
internal ;
set_unescape_uri $key $arg_key ;
redis2_query set $key $echo_request_body;
redis2_query expire $key 36000;
redis2_pass redis;

}

location ~ .php$ {
set $key “nginx-cache:$scheme$request_method$host$request_uri”;
try_files $uri =404;

srcache_fetch_skip $skip_cache;
srcache_store_skip $skip_cache;

srcache_response_cache_control off;

set_escape_uri $escaped_key $key;

srcache_fetch GET /redis-fetch $key;
srcache_store PUT /redis-store key=$escaped_key;

more_set_headers ‘X-SRCache-Fetch-Status $srcache_fetch_status’;
more_set_headers ‘X-SRCache-Store-Status $srcache_store_status’;

include fastcgi_params;
fastcgi_param HTTP_ACCEPT_ENCODING “”;
fastcgi_pass hhvm;
}

I would like to ask your professional instruction on know how to set the redis cache rules to make the video playing?

Thanks in advance, and have a nice day.

Alex

X-Pj-Cache-Status: miss

Hi their,
I just installed your plugin and it seems like it does not work for me :(

Here is what the curl gives me:

Server: nginx
< Date: Wed, 14 Dec 2016 11:43:05 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.6.29
< X-Pj-Cache-Status: miss
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Link: https://url..../wp-json/; rel="https://api.w.org/", https://url.....de/?p=1006; rel=shortlink
< Set-Cookie: PHPSESSID=dihuh83z2rz2rh2i6; path=/
< Vary: Accept-Encoding
< X-Powered-By: PleskLin

Using unix socket?

Hi! Is it possible to use a unix socket instead of tcp?

Apparently the PHPRedis supports it: https://github.com/phpredis/phpredis#connection

I simply did this. Not sure it is correct. Without the port set it failes with a PHP error message.

    private static $redis_host = '/tmp/redis.sock';
    private static $redis_port = '0';
//  private static $redis_host = '127.0.0.1';
//  private static $redis_port = 6379;

Enhancement: Add remote redis support

Hi, Its really great concept. Is there any way to add feature to use remote redis instead localhost? And ability to use custom "redis database id" will be good

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.