JavaScript will not be cached by Chrome

My attempt to have Chrome cache my JavaScript by including a version number in the HTML code as a cache buster seems to not be working. Despite setting up the correct server headers, Chrome continues to reload the 1MiB of Javascript each time. The HTML code looks like this:

<script type="application/javascript" async src="/index.js?version=123"></script> 

The Response Headers are as follows:

HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: public
Content-Encoding: gzip
Content-Language: en-US
Content-Type: application/javascript
Last-Modified: Wed, 23 Jan 2019 15:09:36 GMT
Vary: Origin
Vary: Accept-Encoding
Date: Thu, 24 Jan 2019 00:52:23 GMT
Transfer-Encoding: chunked

Despite ensuring that "disable Cache" is un-selected in the Network tab and turning off "Disable cache (when devTools is running)" in the devTools settings, only my fonts seem to be cached while the index.js file still loads entirely each time.

Answer №1

The issue appears to be related to the use of HTTPS, as my development server lacks a valid certificate. When I switch to HTTP instead of HTTPS, the JavaScript is successfully cached.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ensure that all links are opened in a new tab

When including _blank in the a href URL, my website contains various elements like iframes and ads from Adsense, Taboola,, etc. Currently, when a user clicks on an iframe or ad, it opens in the same window. Is there a way to ensure that all URLs (includin ...

Step-by-step guide on accessing a particular element using jQuery

Looking for help with HTML structure <div class="services-article-elements-single"> <div class="services-article-description"> <button class="services-article-read-more-btn">read more</button> </div> <d ...

Issues Arising from the Implementation of .on() on Newly Added Elements

After learning that .live() has been deprecated, I switched to using .on. However, I encountered an issue where .on is not working for dynamically added elements in the DOM. In my script, a table is added with multiple text boxes (input type="text"), and ...

Troubleshooting a JavaScript Error in AngularJS Module

I created a Module called "app" with some helper functions in the file "scripts/apps.js": angular.module('app', ['ngResource']).run(function($scope){ $scope.UTIL = { setup_pod_variables: function (pods){...} ... }); Now, I want to ...

I am experiencing an issue where jQuery is not functioning properly within my Groovy Server Page

In my Groovy Server Page, I am struggling with a jQuery function that is not running as expected. When my controller's function renders an error message, it appears on the "next" web page instead of on the same page using Ajax. I double-checked that j ...

Tips for customizing the appearance of a child component using the parent component in Vue.js

I am working on creating a layout using Vuejs and flexbox that includes elements like 'header, sidebar, main-content, sidebar, footer'. I have separated each part of the layout into individual .vue files, such as header.vue and sidebar.vue. In ...

Streamlining click event methods in jQuery/JavaScript to make them more efficient

Currently, I am in the process of streamlining all .js functions on my website to enhance page load speed and overall performance. While I have made progress on my own, I hit a roadblock when attempting to condense a few functions that involve callbacks an ...

Output JSON data to an HTTP response in JavaServer Faces

Is there a way to generate dynamic charts using the JavaScript Library "D3.js" within JSF? By dynamically, I mean having a Java method retrieve data from a database and outputting it as JSON. The method for this task has already been written and proven suc ...

Dynamic Selection List Population in jqGrid

Using jqGrid 4.13.3 - free jqGrid In the Add form, there is a static input element and a select list element. The keyup ajax function is bound to the input element using dataEvents in the beforeInitData event. Once the Add form is displayed, entering a va ...

Is the webpage currently being loaded using JavaScript?

I am experiencing an issue with my setInterval function that selects an input and then submits the form by clicking a button. The problem is that the button is being clicked too many times, even after adding a boolean check to prevent multiple clicks. Howe ...

Automated image transition

I had an idea to create a script that would automatically update the graphics on an element, but I hit a roadblock and now I'm stuck on what to do next. The script is supposed to fetch data from the database and include information about: File paths ...

Angular Material: div not being filled by layout-fill

<!-- Container Div --> <div layout-fill> <!-- Image Div --> <div layout="column" layout-align="center center" class="coverImage" layout-fill> <md-content class="md-padding"> Sample Text Here ...

"Encountered an error trying to access property 'replace' on something that is not

https://i.sstatic.net/9jXgB.jpgenter code herehttps://i.sstatic.net/1X1pw.png I'm in the process of developing an online product catalog and when I attempt to access the additional information section by clicking on the designated button, I keep encou ...

Can a website built with VueJs be successfully deployed on Wordpress for a client?

Is it possible to launch a VueJs only client website on WordPress without using templates? I'm curious if this approach is feasible. If so, do you have any recommended tutorials for achieving this? If not, what alternative solution would you suggest? ...

"Mastering the art of binding in Knockout.js using the

I'm currently working on implementing a feature that allows users to create a casting and include an array of categories to this casting entity. I attempted to use knockout's foreach binding for the array of categories, enabling users to add new ...

I am experiencing an issue where the submit button in my HTML form is unresponsive to clicks

Welcome to my HTML world! <form action="petDetails.php" id="animalInput"> <ul> <li> <label for="dogName">Enter Dog's Name:</label><input id="dogName" type="text" name="dogName" /> </l ...

What is the significance of the 'this' context type void not being assignable to type rule?

Currently, I am conducting tests using Typescript to explore the feasibility of a project I have in mind. In one of my functions, I need to specify the type of 'this' as a class. While it technically works, I continue to encounter an error messag ...

Modifying variable assignments in an Angular index.html file according to the environment

Is it possible to dynamically set the config.apiKey value in Angular based on different environments such as Development and Production? In a Production environment, use config.appKey = 'AB-AAB-AAB-MPR'; In a Development environment, use config ...

Struggling to trigger jQuery on postback

I have been searching for a while and experimenting with different solutions from various posts, but I can't seem to make any of them work. Here is the basic idea... I am modifying an existing usercontrol that organizes dynamically generated data into ...

Implementing Response Management with jQuery

When using response.rjs(), the entire response is evaluated as Javascript, a requirement for Rails RJS responses. By calling response.execute(fn), the function object passed to it is executed. .on(responseStatus) will only execute the response function i ...