5

I am trying to find some guidance and a tool for testing whether a page on a website is cached or not. Please could someone advise what is the best process?

1

The link from Yu Zhang in the comments has some good things in it.

It depends on the goal here, usually caching is for performance improvement. If that is the goal then I would think performance testing to be more appropriate than cache testing. If there is a unique situation involving specific cached values then you can utilize anything to read the values and ensure they remain the same. Most browsers have dev tools/firebug/etc... to manually inspect elements as well as measure load times. Selenium can pull the html to verify specific values. There are also client side perf tools like dynatrace, etc... which can do more in depth perf tests on the cached pages to see if they improve in speed.

Is your goal performance related or value specific? You can also manually inject some Javascript calls to interact on the page and ensure certain methods don't go back to the server, but execute locally within cached values. It really depends on the goal though.

| improve this answer | |
0

There are a lot of different types of caching, mostly broadly, server side and client side.

Client Side.

You can look at the http header which has a wealth of information about any caching that the browser is doing. The original http request for any given page will have this information so that subsequent requests can decide if they can/should use it based on the parameters give.

Server Side.

This is a bit trickier. You'll really need server-side access to be able to work with server side caching so you can change things and then test if the changes are shown, cached, etc. It can also be done at many levels such as object caching, page caching, request caching, database caching, etc.

A lot more detailed info at https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching
Excert:
The good news is that every browser ships with an implementation of an HTTP cache. All you need to do is ensure that each server response provides the correct HTTP header directives to instruct the browser on when and for how long the browser can cache the response.
Each resource can define its caching policy via the Cache-Control HTTP header.
Cache-Control directives control who can cache the response, under what conditions & how long.

FYI When you want to force a new version of an asset(file) to be used that is frequently done through unique filenames, frequently using a fingerprint from the file contents and using that fingerprint in the filename. This gets around the client side held cache because a differently named file does not exist by that name in the cache and so is not used from cache and is fetched from the server.

| improve this answer | |
0

If you want to know whether a page on a website is cached or not, try modifying the database directly. The backend server should not know about your action and will not refresh the cache accordingly. Now if the changes are reflected on the UI immediately, I think the content have not been cached.

| improve this answer | |
0

Certain browsers (such as vivaldi) allow you to show/hide what is and isn't being loaded from the browser's cache. When performing manual testing this can allow you to easily switch between the modes to ensure what you are loading is coming from the server on page load.

enter image description here

| improve this answer | |
  • Of note, Vivaldi uses the Chrome rendering engine, so a page looks and loads the same in this as in Chrome – ECiurleo Jul 10 '17 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.