When trying to perform well in Google's Pagespeed insights, we've hit a situation.
We enabled mod_pagespeed and that worked. It did what it's supposed to do.
However, when looking at the results, on GT Metrix and Pagespeed Insights when we have mod_pagespeed enabled, mod_expires and browser caching doesn't work.
Is this by design? If so, is there anything globally or via .htaccess to I can code in to make browser caching happen?
I have same problem, also my css links that are indeed moved to footer by pagespeed's prioritize_critical_css are causing render-blocking error.
It happens even if I set pagespeed to ONLY do above-the-fold css optimization:
<IfModule pagespeed_module>
ModPagespeed On
ModPagespeedRewriteLevel PassThrough
ModPagespeedEnableFilters prioritize_critical_css
</IfModule>
When I set ModPagespeed Off, problem dissapears... For now I see browser caching warning for png images mostly (I have mod_expires set to "access 1 year", but when I'm trying to use extend_cache in pagespeed instead mod_exipre, even more browser caching warnings appear).
After some google search i found this removed the warning from insights:
ModPagespeedInPlaceResourceOptimization off
Docs on In-Place Resource Optimization.
Here is an answer, by Matthias Redl-Mann, I discovered in google products forum:
So I could solve the problem: The apache user had no access to the
cache directory. Setting a different Cache Path via the
ModPagespeedFileCachePath directive solved the problem. After setting
a path with access for the apache user, everything worked.
Related
I've used a boilerplate to create a website and I've tested it on https://testmysite.thinkwithgoogle.com/ and it said I have to leverage my browser cache. After doing some research, it says I have to add this tweak in .htaccess. The issue is that this tweak already exist in boilerplate .htaccess so I'm not really sure why the speed checker said I should be leveraging my browser cache?
Any insights why it gives this error?
Update: I've tested it on gtmetrix, it says I have to leverage browser cache of bunch of img, js, and css files. I've checked .htaccess files and there the expires tag of all the mentioned above files. Still no clue why it keep giving that note?
After doing extensive research, I found that git hub web pages don't allow for server configuration, so using .htaccess wouldn't leverage my browser cache. Hoping that github would solve this issue.
i am getting issues for Leverage browser caching for images on Google page speed tool. I have search all web for this issue but not get any solution.
I have tried total cache, wp super cache, zencahe,etc and i have also tried to edit my ht-access file for this and defined expiration for each image type but still i am getting this issue. Can you help me out please.Please tell me what is the cause of this issue so that i am beware next time.I also get this issue when i enable g-zip compression from ht-access file.
Your suggestion will be valuable for me.
Thanks
So I have tested my page via Googles Page Insights
And it is currently telling me to:
Leverage browser caching for the following cacheable resources:
http://maps.google.com/maps/api/js?sensor=false&language=en (30
minutes)
Its rather ironic as its a google resource from a google server But
Its always good to know how to do things I've tried to read about how to do this on a link google provided on the test page however it didn't really give an example of how to cache this external resource I've tried reading as much as I can and adding bits into my htaccess file but nothing seems to work.
So I guess my question firstly is, is it even possible via the .htaccess file to cache this resouce?
And if so how what code would I need to put in there to get it to cache the resource?
Thanks you In advance for any help.
You can't control the caching of resources served from third party. htaccess is to control caching for resources served out of your own boxes.
I've copied my live website to my localhost for migrating into higher version. The problem that has been arises is that my menus and components are not opening and it's saying that it does not found any articles and components that has been assigned to menu. So i just want to know that if i will upgrade my joomla website which is currently has 1.5.26 version to 2.5 then will it effect on my website when i will upload it later on after migrating into higher version. Will everything will gonna work fine or still having a htaccess issues or not?
First make sure that mod_rewrite is enabled in you Apache config.
What errors do you get - a 500 ?
There is no guarantee it will work after the upgrade. You need to get it working on the local site before upgrading in my opinion.
Try disabling SEF urls and see if the site starts working. If it does then you know that it is an .htaccess issue and you should be OK to upgrade and upload.
I am working on one website which is developed in .net. I have uploaded .htaccess files but its nt working.
Is there any new idea for that? I want that my site will be crawled with www.
Thanks
.htaccess is not just for PHP.
It's a configuration file that's read by the Apache HTTP server. So if your application is not running on that server, then that file will not have any effect.
.htaccess and PHP are orthogonal. One is a configuration file for Apache; the other is a scripting language. More than likely, you're using Microsoft's IIS server, not Apache.
The .htaccess file is a configuration file for the Apache web server, and is not dependant on PHP. It typically contains settings relating to web site user permissions, friendly URL definitions, etc.
It can, however contain configuration settings for PHP, if you have settings which are in the server's PHP.ini file that you want to override for this specific web directory.
There are many reasons why a .htaccess file may not work -- it can be broken by some very subtle things, and a faulty .htaccess file will normally cause the whole site to stop working completely, regardless of what the error is.
In this case, the browser will usually simply show an error 500, without much useful information to help you debug it. But there will be more helpful debugging data in the server error log.
If you still struggle with it, you should post your .htaccess file here so we can help you debug it.
However, as #Tomalk says, if you're developing a .NET site then you're probably not using an Apache web server; you're probably using an IIS server. In that case, there are entirely different ways of setting the configuration for the server, and it won't know what to do with .htaccess file.