mod_pagespeed not loads the static files to the cache folder - mod-pagespeed

Hi I have started exploring PageSpeed module in Apache Httpd. I have used ModPagespeedLoadFromFile for doing hotfixes. Is it correct? Or do we have any other option the hotfixes of static files using PageSpeed.
The problem is while using ModPagespeedLoadFromFile, only the files under the ModPagespeedLoadFromFile are cached in ModPagespeedFileCachePath. The rest of the static files fetched from the server are not cached at ModPagespeedFileCachePath.
Kindly anyone correct me what I am doing wrong. Thanks in advance

I'm not sure what you mean by "hotfixes"?
But assuming that you mean that rewritten resources are immediately updated when you make updates to the original resource? That is a feature of LoadFromFile, you can also use cache flushing for that.
I don't understand the FileCachePath half of your question at all. What is the problem that you observe? Files not being rewritten? Broken files?

Related

JS Files not updating in Site Assets

Ok, I have never seen anything like this before and hoping someone else has. I just finished patching our Dev and Test servers to Nov2017CU (SharePoint 2013). Since then, any solutions that are using JS injection from Site Assets are not updating. I'll make a change to the file, the library reflects that I made the change, but when I attempt to load the page accessing the js file, the changes are not reflected. Hard refreshes and full cache cleans are not affecting it. If I close and reopen my editor (VSCode) my changes are gone. When I look at the version history, the current version doesn't have my changes, but the previous version does. If I try to revert to that version, it doesn't take (still shows the previous version of the file).
Here's where it becomes extra weird. I have deleted the entire file from the library. Reset IIS (heck, I even rebooted the server at one time). It somehow still loads the file. The file is no longer in the library, but the server is still serving it up to the browser. I have confirmed it is not getting it from another location as the Dev tools are showing the file is located in the Asset Library the file was deleted from. Even users who have never accessed the site before are still getting that file in their browser.
This isn't limited to a single site either. I have other developers in different sub sites (same site collection) that are having the same issues.
Anyone seen this before?
Looks like your web application has BLOB cache enabled which is causing files to served from the cache.
There are 2 ways to fix:
1) The heavy handed way would be to flush the BLOB cache using powershell commands mentioned:
$webApp = Get-SPWebApplication "<WebApplicationURL>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlob‌​Cache($webApp)
This will flush all the files in the BLOB. Usually, the files are cached based on the max-age attribute value. So, that is the reason that your files are being served even if you had deleted it from the source.
2) The surgical knife approach would be to append a query string, like (https://sitecollurl/siteassets/app.js?v=1.1), to the file references (usually in master page, page layouts, webpart references, script links etc. wherever it is referenced). When you append a query string to the file, it will force the browser to download the newer version of the file. Would prefer this approach as it will not unnecessarily clear other files from BLOB.

why download apk file is buffered and gives user old version

We hold our landing page on Azure and it is for users to download an Android apk file. This landing page is a html file. Here is the markup for users to download:
download here
It all works fine until now. Users start to complain that the app they downloaded cannot work properly. But when we tested, it works fine.
Finally we find out that, although the link is
http://www.[mysite].com/android/[MyAndroidApp].apk
but sometimes when user click it, it goes to
http://101.44.1.131/cloud/223.210.55.28/files/9216...636//www.[mysite].com/android/[MyAndroidApp].apk
This is a buffer and holds an old version of our app!
Can anyone tell me why this happen and how can I prevent it buffer our old version?
How often do you update this apk file?
May be a caching issue, but not sure exactly.
Have you tried using Azure storage? Upload the file on there, and then link directly to it.
Should cost you less in the long run and not cause any buffering/cache issues
I would suggest you try to put version numbers after your filename. This is also a good practice for .js files. A problem is very often that it's cached and the cache not updated correctly. It's a general problem in the web.
So. Try to put version numbers after the file name, and let us know if this works.
Thank you all for your suggestions.
We have found the reason. Looking at the redirect url, it is actually some ISPs cached our apk files. They are doing this so that they can save themselves money and bandwidth. This is a common practice in some countries and is well documented.
How evil it is.
Our solution is thus change the file name very time we deploy a new version.

Security extension for Magento, scanning server for changes files

I use a plugin for WordPress called "WordFence". It works by scanning all files on the server and checking for changes or suspicious code.
I am looking for something similar to Magento. Does it exist?
To put it another way, I am looking for an extension to help with security, and scanning files looking for changes would help a lot.
You should use a version control system for that, as it does exactly what you describe (and more).
For example, git status will show you all modified files since last release. You could use .gitignore to exclude media files and other volatile stuff.
See Yireo's tutorial on git and Magento on how to get started.

Opening a website is getting delayed

First of all thanks to everyone who have supported me in this forum to solve critical issues and thanks in advance for this question.
I am building a website http://kidneyprostate.com where I have used wordpress too. The index file is a php file which is HTML5 and the all other files are in Wordpress.
What I have done I have kept all other files including the blog in a Subfolder named as http://kidneyprostate.com/kidney-prostate.com/ inside the root folder.
I found everything worked fine. But after few days my server got Bandwith Speed exceeded and my host company rectified it.
Now what I am facing that the site is getting delayed to open. I have checked with Pingdom Tools and I have optimized the images (those for slides), Minified the CSS and Javascript files. But still the delay problem persists.
Reasons I am guessing may be due to the same name of the sub folder or the bandwith speed have not yet been totally rectified.
Can you please help me that am I guessing correct or any other issues?
If my naming of the subfolder i.e. kidney-prostate.com is not the right way then after changing the name of the subfolder will work?
Thanks again in advance.
The "same-name" url has nothing to do.
1) Use a cache plugin (I would recommend WP Super Cache) and deactivate all the unnecessary plugins.
2) Delete all the unused themes and images.
3) Also I would consider that you deactivate some heavy bandwidth plugins (like google-analytics ones)

How do I move ExpressionEngine (EE) to another server?

What are the best steps to take to prevent bugs and/or data loss in moving servers?
EDIT: Solved, but I should specify I mean in the typical shared hosting environment e.g. DreamHost or GoDaddy.
Bootstrap config is the smartest method (Newism has a free bootstrap config module). I think it works best on fresh installs myself, but ymmv.
If you've been given an existing EE system and need to move it, there are a few simple tools that can help:
REElocate: all the EE 2.x path and config options, in one place. Swap one URL for another in setup, check what's being set and push the button.
Greenery: Again, one module to rule them all. I've not used this but it's got a good rating.
So install, set permissions, move files and and DB, and then use either free module. If you find that not all the images or CSS instantly comes back online, check your template base paths (in template prefs) and permissions.
I'm also presuming you have access to the old DB. If not, and you can't add something simple like PHPMyAdmin to back it up, try:
Backup Pro(ish): A free backup module for files and db. Easy enough that you should introduce it to the site users (most never consider backups). All done through the EE CP. The zipped output can easily be moved to the new server.
The EE User Guide offers a reasonably extensive guide to Moving ExpressionEngine to Another Server and if you follow all of these steps then you will have everything you need to try again if any bugs or data loss occur.
Verify Server Compatibility
Synchronize Templates
Back-up Database and Files
Prepare the New Database
Copy Files and Folders
Verify File Permissions
Update database.php
Verify index.php and admin.php
Log In and Update Paths
Clear Caches
As suggested by Bitmanic, a dynamic config.php file helps with moving environments tremendously. Check out Leevi Graham's Config Bootstrap for a quick and simple solution. This is helpful for dev/staging/prod environments too!
I'd say the answer is the same as any other system -- export your entire database, and download all of your files (both system and anything uploaded by users - images, etc). Then, mirror this process by importing/uploading to the new server.
Before I run my export, I like to use the Deeploy Helper module to change all of my file paths in EE to the new server's settings.
Preventing data loss primarily revolves around the database and upload directories.
Does your website allow users to interact with the database? If so at some point you'll need to turn off EE to prevent DB changes. If not that you don't have too much to worry about as you can track and changes on the database end between the old and new servers.
Both Philip and Derek offer good advice for migrating EE. I've also found that having a bootstrap config file helps tremendously - especially since you can configure your file upload directories directly via config values now (as of EE2.4, I think).
For related information, please check out the answers to this similar Stack Overflow question.

Resources