also suggest you adjust your cookie settings
; The domain for which the cookie is valid.
; http://php.net/session.cookie-domain
session.cookie_domain = your domain
; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
; http://php.net/session.cookie-httponly
session.cookie_httponly = on
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
Code: Select all
$pushImage = false;
Code: Select all
$use_cookie = true;
and some correction of your code
Code: Select all
// determine cookie domain
$domain = str_replace('https://','',HTTPS_SERVER);
$domain = str_replace($subDir,'',$domain);
$domain = str_replace('www','',$domain);
Code: Select all
// determine cookie domain
$domain = str_replace('https://','',HTTPS_SERVER);
$domain = str_replace($subDir,'',$domain);
$domain = str_replace('www.','',$domain);
$domain = str_replace('/','',$domain);
Code: Select all
setcookie('NAME',$DATA,$EXPIRE,"/"."; SameSite=strict",$DOMAIN,$SECURE,$HTTPONLY);
Code: Select all
setcookie("h2p", json_encode($pushed_cookie_array), time() + 60 * 60 * 24 * 1, "/".'; SameSite=strict', $domain, true, true);
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
set
Code: Select all
$relative = true;
headers sets
Code: Select all
<catalog/view/theme/journal3/assets/f95d5250a0d8042d17cc7d310c7cf442.css?v=3.0.46>; rel=preload; as=style,<catalog/view/theme/journal3/assets/62fa9ca2cff78f80999ae3d2891dd56b.js?v=3.0.46>; rel=preload; as=script,<catalog/view/theme/journal3/assets/844e066d983585e43f5c8b152e8fc920.js?v=3.0.46>; rel=preload; as=script
Code: Select all
$pushImage = true;
Code: Select all
<catalog/view/theme/journal3/assets/f95d5250a0d8042d17cc7d310c7cf442.css?v=3.0.46>; rel=preload; as=style,<catalog/view/theme/journal3/assets/62fa9ca2cff78f80999ae3d2891dd56b.js?v=3.0.46>; rel=preload; as=script,<catalog/view/theme/journal3/assets/844e066d983585e43f5c8b152e8fc920.js?v=3.0.46>; rel=preload; as=script,<https://www.priazha-shop.com/image/catalog/main/priazha1.png>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/main/priazha-main1a-1812x468.png>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/transparent-70x70.png>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizeLanaGoldFine/alize-lana-gold-fine-583-70x70w.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizeAngoraGold/alize-angora-gold-01-70x70w.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizePuffyFur/alize-puffy-fur-6117-70x70.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizeAngoraGold/alize-angora-gold-339-70x70w.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizeMissbatik/alize-miss-batik-3713-70x70w.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/products/AlizeLanaGoldClassic/alize-lana-gold-classic-44-70x70w.jpg>; rel=prefetch; as=image,<https://www.priazha-shop.com/image/cache/catalog/main/priazha-main1a-150x38fill.png>; rel=prefetch; as=image
You can use that variable to make relative paths absolute, not absolute paths relative.
That would give you problems when you use virtual paths sections like language and you do not want to make urls which need to be absolute, relative, visa versa is ok.
Better make your image paths relative, which can be relative, in your html.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
https://www.computersystems.fun
no SEO, no Journal
all push in true.
when
Code: Select all
$use_cookie = false;
in header:
Code: Select all
link: <catalog/view/javascript/bootstrap/css/bootstrap.min.css>; rel=preload; as=style,<catalog/view/javascript/font-awesome/css/font-awesome.min.css>; rel=preload; as=style,<catalog/view/theme/default/stylesheet/stylesheet.css>; rel=preload; as=style,<catalog/view/javascript/jquery/magnific/magnific-popup.css>; rel=preload; as=style,<catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css>; rel=preload; as=style,<catalog/view/javascript/jquery/jquery-2.1.1.min.js>; rel=preload; as=script,<catalog/view/javascript/bootstrap/js/bootstrap.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/moment/moment.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/moment/moment-with-locales.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js>; rel=preload; as=script,<catalog/view/javascript/common.js>; rel=preload; as=script,<https://www.computersystems.fun/image/catalog/cart.png>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-228x228.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-74x74.jpg>; rel=prefetch; as=image
js - present
images - present
fonts - absent
when
Code: Select all
$use_cookie = true;
Code: Select all
link: <https://www.computersystems.fun/image/catalog/cart.png>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-228x228.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-74x74.jpg>; rel=prefetch; as=image
Code: Select all
<catalog/view/javascript/bootstrap/css/bootstrap.min.css>; rel=preload; as=style,<catalog/view/javascript/font-awesome/css/font-awesome.min.css>; rel=preload; as=style,<catalog/view/theme/default/stylesheet/stylesheet.css>; rel=preload; as=style,<catalog/view/javascript/jquery/magnific/magnific-popup.css>; rel=preload; as=style,<catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css>; rel=preload; as=style,<catalog/view/javascript/jquery/jquery-2.1.1.min.js>; rel=preload; as=script,<catalog/view/javascript/bootstrap/js/bootstrap.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/magnific/jquery.magnific-popup.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/moment/moment.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/moment/moment-with-locales.min.js>; rel=preload; as=script,<catalog/view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js>; rel=preload; as=script,<catalog/view/javascript/common.js>; rel=preload; as=script,<https://www.computersystems.fun/image/catalog/cart.png>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_1-228x228.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_7-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_6-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_5-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_4-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_3-74x74.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-500x500.jpg>; rel=prefetch; as=image,<https://www.computersystems.fun/image/cache/catalog/demo/samsung_tab_2-74x74.jpg>; rel=prefetch; as=image
Code: Select all
error_log(print_r($headersAlls,true));
Code: Select all
$headersAlls = implode(',',$headersAll);
But with cookie enabled, it will only push the js and css headers once, the cookie tracks if those were send already for that route.
It will still send the image push headers regardless if the always_image_ variable is true for that route.
if you want the error log to reflect what is send or not you should use:
Code: Select all
if ($push) {
if ($headersAlls) {
error_log('Pushing all for route:'.$this->request->get['route'].' -> '.$headersAlls);
header('Link: '.$headersAlls, false);
} else {
error_log('Pushing nothing (no headers) for route:'.$this->request->get['route']);
}
} elseif ($always_img) {
if ($headersImage) {
$headersImage = array_unique($headersImage);
$headersImages = implode(',',$headersImage);
error_log('Pushing images only for route:'.$this->request->get['route'].' -> '.$headersImages);
header('Link: '.$headersImages, false);
} else {
error_log('Pushing NO images only (always_img = false) for route:'.$this->request->get['route']);
}
} else {
error_log('Pushing nothing (nothing to push) for route:'.$this->request->get['route']);
}
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
viewtopic.php?p=790197#p790197
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
only OpenCart. default theme.
OpenCart from box use fonts or not?
not whole understanding logics but may be images push twice? first to cookie, second directly to header?
cookies enabaled and disabled
consolidate push or individual push.
image push not work in any variants
even individual link added to header for each image.
The push track cookie version I posted does not have a consolidate or individual push so what code are you now using?consolidate push or individual push.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I try and test all possible variants.
I replace
Code: Select all
if ($headersAlls) header('Link: '.$headersAlls, false);
Code: Select all
if ($pushCss) {
$headersCss = array_unique($headersCss);
foreach($headersCss as $headerCss) header('Link: '.$headerCss, false);
}
if ($pushJs) {
$headersJs = array_unique($headersJs);
foreach($headersJs as $headerJs) header('Link: '.$headerJs, false);
}
if ($pushFont) {
$headersFont = array_unique($headersFont);
foreach($headersFont as $headerFont) header('Link: '.$headerFont, false);
}
if ($pushImage) {
$headersImage = array_unique($headersImage);
foreach($headersImage as $headerImage) header('Link: '.$headerImage, false);
}
if ($pushMp3) {
$headersMp3 = array_unique($headersMp3);
foreach($headersMp3 as $headerMp3) header('Link: '.$headerMp3, false);
may be problem in some incompatibility with Journal theme?
That is great, not sure about journal and its caching but you were generating push headers before so I doubt it is that.
You do have a very slow server though or maybe that is because of journal itself and the enormous amount of journal css you put out inline does not help with the speed of the regex trying to find the links in there.
I don't have journal so I don't know how that works, I can only see what its result is.
You also may have to look at nginx and http/2 push:
https://www.nginx.com/blog/nginx-1-13-9 ... matic-push
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
https://www.priazha-shop.com and https://www.computersystems.fun on same hosting in same account.
two folders on same disk.
read some articles about Server Push.
some authors says that not good idea push all resources.
- first step push css
- second push another and check performance
I have a lot of big high res images on store and may be best way push only css and js?
or may NOT push they?
Code: Select all
Link: </nginx.png>; as=image; rel=preload; nopush
links in header added, but push not work! why?
Nginx
http2_max_concurrent_pushes by default sets to 10?
not check real size. use pattern.
all images in image cache have in name they file name size
product-name-40x40.jpg
product-name-60x60.jpg
product-name-80x80.jpg
product-name-100x100.jpg
……..
product-name-500x500.jpg
product-name-1000x1000.jpg
…...
product-name-4000x2722.jpg
how filter and try add only 40x40, than try add 60x60 …..
for example:
Code: Select all
if ( strpos($file,'40x40') != false ) { $headersImage[] = '<'.$file.'>; rel='.$method_img.'; as=image';}
Users browsing this forum: No registered users and 131 guests