Google pagespeed and image_rewrite for direct requests - nginx

I have successfully installed Google pagespeed (it took me a while to get it up and running with nginx).
I'm using Meteor as my framework and would like to use image_rewrite. The thing with Meteor is that the HTML gets rendered on the client. Obviously the typical scenario will never pass by pagespeed, meaning pagespeed cannot optimize the page.
What I would like to do is that pagespeed optimizes the image on the http call for that image, but for some reason this does not work. Example:
If i open http://mydomain.com/myimage.jpg in the browser that image should be "pagespeeded" by all the filters that are active. Unfortunately this does not work. Any ideas?

It sounds like you want to turn on InPlaceResourceOptization:
pagespeed InPlaceResourceOptimization on;

Related

Google Pagespeed Insights (Lighthouse) is telling that I'm not using jquery

On the report of Google Pagespeed Insights on my website I get this suggestion:
When I use the Coverage tab on Chrome Dev tools, just 30% of the jquery.min.js file is not used
Therefore I have the following questions:
If the file is used, why am I getting this suggestion? A bug?
Am I supposed to split the jquery file in two, and load initially just the used part? I've never seen that.

mod_pagespeed - internal cache purge issue

I use mod_pagespeed on my Nginx-Webserver.
When I try to test some of my pages with Google Pagespeed Insights(https://developers.google.com/speed/pagespeed/insights) there are:
1) Many errors shown the first time I do this, when the page is not opened manually with a browser before.
2) At the second scan - or if I open my page manually with a browser before - Google Pagespeed Insights shows me 90+% instantly.
Some of my sites do not have very large traffic, cause they are niche specific. I do this speed-optimation mostly for ranking purpuses. Now I am worried that Google doesn't see the 90+% when they test my site, because the first scan shows 70-80% and many errors...
Ok... so I think mod_pagespeed purges its internal cache after a while and when the first one opens the site there are no optimized files and because optimation takes to much time, the first user gets some files without full optimation. Right?
My approach nr.1:
I have done some optimation so keep the cache for 12h, but my tests show me that it doesn't work. Are here any mistakes in my attempt?
#experimental mweber 400mb 12h
pagespeed FileCacheSizeKb 409600;
pagespeed FileCacheCleanIntervalMs 43200000;
pagespeed FileCacheInodeLimit 500000;
My approach nr.2:
My hoster give me the advice to warm up the cache with a wget-script, which opens my pages from time to time. I tried that but it doesn't show any effect, so are there any requirements or parameters I have to use with wget, so mod_pagespeeed starts optimation of files?
Would be great to get some tipps and advices from you! ty :)
wget will not trigger any caching, if caching was only triggered via request then wget would not access the files to trigger them anyway as it does not process html to trigger requests on the assets.
Why are you clearing the cache so soon?

Pagespeedmodule - Build a ressources server

I use Nginx and I have installed Google PageSpeedModule on one of my domain. This module is really usefull, and easy to use. All CSS and JS are minified, my images are compressed... it has reduced the weight of 500 kb of my pages.
My question is, can I use this module to deliver only ressources ? I create a kind of CDN, containing all my CSS, images, JS... But, I installed Nginx + pagespeedmodule and the module is not working for one image only for example. But it works with an HTML page and compress the images in this page, but can it work with a direct access image ? Thanks.
Yes, you can use InPlaceResourceOptimization to optimize images even if they are not optimized in HTML (Note: That doc says that this is an Apache-only feature, but that's out of date, it works in the latest Nginx as well.). Add this command to your config:
pagespeed InPlaceResourceOptimization on;
Note that the default way that ngx_pagespeed works is by rewriting resources found in HTML. That is the most efficient way to run it. If you only use InPlaceResourceOptimization you will not get some advantages like cache extension and image resizing. However this is a convenient feature if you cannot optimize resources in HTML.

how to check if Leverage browser caching is enabled

I Was wondering if there exist an method using which i can check if an website has Leverage browser caching enabled or not and if enabled then for how much time
example an css file link like http://foo.com/foo.css or an image link http://foo.com/foo.img
now how to know if Leverage browser caching is enabled in them and its configuration.
you can use pageSpeed From Google to help you search for the Laverage browser caching.
This website: http://gtmetrix.com/leverage-browser-caching.html can create a insight of all the performance you can gain by optimizing your website.
Check if browser caching is enabled (and expiration) https://www.giftofspeed.com/cache-checker/
also, GTmetrix may warn "Leverage browser caching for the following cacheable resources:" for .SVG files (ignore if so)

HTTPS does not work - Secure and Non secure data on web page?

I have a browser compatibilty problem with https? I have SSL installed and is in usage. Until today morning, my https part is working well. From then, Https is shown as https(with slashed in red color) saying the page has some insecure content.
I have not changed any code and suddenly i see this problem in chrome. In IE 8, i see the same problem but on every page, it shows me a popup if i should allow to opne secure and non secure or just secure. Firefox has no issues . It shows correct https without any problem. I am fed up with it searching all over. Why is this happenening for me in Chrome and IE 8.
Could someone tell me what the problem is and what can be done to solve it!
PS: I have also checked if the page source is any different when IE8 showed with and without secure data. Everything is the same. but viewstateID was different. Is that something that is creating this problem?
Thanks a lot in advance.
This is usually caused by having the absolute path to a resource specified somewhere on the page without having https specified, eg:
<img src="http://someurl.com/image.png">
If it's a link to something on your site, use https: or a relative path.
DO you have any 3:rd party javascript included, like google analytics or other that might have changed.
If you try with Firefox there is firebug you can add as an addon.
In there is a tab for network (net).
It lists everything the page loads.
In that list you should be able to find anything that gets loaded without https.
IE (correctly) complains when there is mixed http/https content as a security warning. Most other browsers do not typically complain when dealing with mixed content so your source is very likely the same in both instances.
I would second David MÃ¥rtensson's answer and say the issue is likely a third party library (google or MS hosted JQuery for example) or static asset server.

Resources