Resolved Changes in javascript that I edit and save in x10hosting not active

ejlx10ho

New Member
Messages
10
Reaction score
0
Points
1
I typically use x10hosting to edit and save changes in a javascript. However, using Chrome DevTools, I see that changes are not implemented. Why is that?
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
It could be caching; are you forcing the browser to clear the cache when you reload? Some software can add serial numbers to the javascript file name to avoid caching old values, or you can add no-cache headers using .htaccess (as long as you remember to remove them later!). Some software such as cloudflare also (intentionally) caches these files and you would have to put it into live move to prevent this, or disable it entirely for a time. I found this code for disabling all caching on LiteSpeed HTTPD, which is what your server uses:

Code:
RewriteEngine On
RewriteRule .* - [E=Cache-Control:no-cache]
 

ejlx10ho

New Member
Messages
10
Reaction score
0
Points
1
THANKYOU, garrettroyce! I learned that I can clear cache manually with Chrome DevTools, and that solves the problem.
However, I do not understand how to implement the code you suggested (RewriteEngine on ...). Where do you insert his code or otherwise how to implement it?
 

spacresx

Community Advocate
Community Support
Messages
2,199
Reaction score
195
Points
63
Where do you insert his code or otherwise how to implement it?

You would insert the code in a .htaccess file that would be in your
root > domain name > public_html folder.
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
One thing that's tricky for new users is that Linux doesn't treat the period character "." as anything special EXCEPT if it is the first character. So a file named .htaccess (notice the period as the first character) is a special file called a dotfile (because it starts with a dot). It's easy to make the mistake and call the file "htaccess" (no dot) because it's a Linux thing and Windows doesn't usually do this.

@spacresx is exactly right about the file; if you created your index.html or index.php file and it works, make your .htaccess file in the same folder, which is the one provided
 
Top