My site has been moved to a new server recently, and now it's having some serious issues with response time. I have to wait 4+ seconds for the site to begin loading when navigating to the homepage.
I traced it down to mod_deflate. If I disable gzipping HTML, it's fine, otherwise the 4+ seconds response time is there again. Only compressing the HTML seems to be the problem, not CSS, JS or any other files.
Everything worked like charm on the old server, and I haven't changed any setting. What should I do to let Apache GZIP the HTML without this slowdown?
ps. please note my site is on a shared hosting and I do not have access to httpd.conf or PHP ini settings. I can edit .htaccess only.
Related
I have just started developing for a few weeks now and I bought a domain, but when I upload the files on live, the website looks different than what I have uploaded. Now, this gets fixed when I clear my cache. The problem is that my visitors enter, they see the page in a way, and after I update it they see it as the previous version!
Is there any possible solution for this? I don't want my visitors to clear cache every time I make a change on my website!
This is quite probable to be due to css cache. Your server is loading a cached version. You can specify the cached time in a few ways. Etags and htaccess (on apache) are the most common.
A very simple trick is just to add at the end of your style link url (where you load your main style in the head of the document) a get-like parameter: just like this:
main.css?v=2
I have a problem in my Umbraco backoffice, where alot of the clientside files are cached heavily, which is causing some problems.
All the files loaded, is from /umbraco/Application and contains references like;
"/umbraco/lib/jquery/jquery.min.js?cdv=1",
"/umbraco/lib/angular/1.1.5/angular.min.js?cdv=1",
"/umbraco/lib/underscore/underscore-min.js?cdv=1",
But, how can i change the cdv value? I tried to change it under /config/ClientDependency.config, but nothing happend (it is not the same value in the config file and in the output above).
So maybe the backoffice is using a different config file for ClientDependency? Or any other ideas?
On my Umbraco 7.4.1 installation, changing the version of clientDependency.config worked for me:
From:
<clientDependency version="1" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
To:
<clientDependency version="2" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.UI.CdfLogger, umbraco">
After the change, the script files were being called as:
/umbraco/lib/jquery/jquery.min.js?cdv=2
/umbraco/lib/angular/1.1.5/angular.min.js?cdv=2
/umbraco/lib/underscore/underscore-min.js?cdv=2
Etc.
If it's only your browser with this issue (rather than a clients whose you don't have access to), then you can just force your browser to load new version of HTML, CSS and JS rather than using the internal HTTP cache.
How to tell if you're loading cached resources
You will know if your browser has cached the resources by looking at the Network tab in your browsers Dev Tools. If resources are being loaded with a 304 rather than a 200, they have been loaded from the internal cache.
Forcing reload on Chrome
There is a SO post here which tells us the difference between each reload option.
General browser shortcuts
There is also a bit of information here about how you can use a keyboard shortcut to force a hard refresh on your browser.
Plugins
Clear Site Cache has worked quite well as a browser plugin for Firefox for me.
Upon loading my site (https://ameersavage.com), certain images do not load in Chrome. Upon reloading the page, the results vary. Rarely does everything load properly in Chrome. This only started happening once I uploaded the site to the server.
When I uploaded the site using the server's online cPanel, none of the assets appeared until I started fiddling with each individual file's permission. I then tried uploading the site using FTP (Transmit) which produced far better results, but still certain assets sometimes do not always show up once the page loads.
Do you think this is a reflection of poor server performance? I wanted to get a second opinion before I subscribe to a new server provider (any recommendations?).
I have a WordPress site that is doing a few weird things, and I believe it is because it is being cached. I changed the contents of a CSS stylesheet file, and the change took around 10 minutes before it appeared live.
I can't however find any caching mechanism setup. I've looked through cPanel and can't see anything setup there. The IP of the site resolves to the IP that cPanel is showing.
I've looked for plugins in WordPress and can't see any caching plugins (although if it was a caching plugin, would accessing a stylesheet be cached?).
Any tips on how I can see if the page is being cached on the server or by a plugin?
Put a JavaScript bug on the page which crafts a random URL and requests it. Compare the number of page requests to random URL requests. But there are lots of scenarios where a browser can cache a page in the absence of caching information.
If your website is behind Cloud Flare network or such, this is normal behavior.
Try running next command (Windows Command prompt/Linux terminal):
ping www.yoursite.com
and visit resolved IP address in browser - this may tell you if you are behind caching network.
Take a look at this article: http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/
I am using cloudflare, W3 Total Cache, and amazon s3. I am using database, page, object, and browser caching via W3TC.
What causes the delay in receiving data from the server as seen here? This is incredible, I feel it might have been faster without W3TC installed.
Screenshot of headers
A couple of thoughts.
It looks to me like there are two 404s on the home page, so probably good to get them fixed:
http://cdn.thedigitalhippies.com/wp-content/themes/sahifa/fonts/BebasNeue-webfont.woff
http://cdn.thedigitalhippies.com/wp-content/themes/sahifa/fonts/BebasNeue-webfont.eot?
There are 20 odd CSS files on the page and plenty of js files. I think you would get good improvement if you combined and minified these into single CSS and JS files with somthing like http://wordpress.org/extend/plugins/wp-minify/
Hope this helps!