GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Fuck browser caching (https://gfy.com/showthread.php?t=1305434)

2MuchMark 11-05-2018 01:03 AM

Fuck browser caching
 
I despise browser caching. Trying to debug a program but stupid browser and or stupid server is still throwing errors because the js file its using is an old, cached one.

Major (Tom) 11-05-2018 01:31 AM

Quote:

Originally Posted by 2MuchMark (Post 22361546)
I despise browser caching. Trying to debug a program but stupid browser and or stupid server is still throwing errors because the js file its using is an old, cached one.

I feel your pain

SBJ 11-05-2018 01:34 AM

can't you just clear your cache or am I missing something?

faperoni 11-05-2018 03:28 AM

Or add something like file.js?version=2 this way you can be 100% sure you and your users grab a fresh copy.

awxm 11-05-2018 03:55 AM

In Chrome, open developer tools, go to Network tab, check 'disable cache', refresh page.

just a punk 11-05-2018 05:29 AM

Shift+F5

Klen 11-05-2018 06:22 AM

Quote:

Originally Posted by CyberSEO (Post 22361624)
Shift+F5

Yep works every time

2MuchMark 11-05-2018 07:55 AM

No this time its different. This is the clients server that is caching, and the file its caching is a .js file. What's extra frustrating about this is that it took forever to realize it.

Klen 11-05-2018 08:43 AM

Quote:

Originally Posted by 2MuchMark (Post 22361704)
No this time its different. This is the clients server that is caching, and the file its caching is a .js file. What's extra frustrating about this is that it took forever to realize it.

Well in that case, you are screwed :1orglaugh Actually, you need to identify what method they use to store you as unique user and then change required part. For example, they could store based on your ip, or your user agent of browser.

wankawonk 11-05-2018 02:10 PM

do you have access to the server? I would just add a version number to the filename. Hopefully they coded their site so that the filename doesn't have to be changed in every single template

but who the fuck is caching javascript server-side? I struggle to imagine a situation where that would ever make sense

Miguel T 11-05-2018 11:13 PM

Most likely it's a load-balanced server, try getting the direct IP into your hosts file to debug quicker

wankawonk 11-06-2018 01:06 AM

Quote:

Originally Posted by Miguel T (Post 22362226)
Most likely it's a load-balanced server, try getting the direct IP into your hosts file to debug quicker

you're right, if the JS file is behind a load balancer or CDN it might be getting cached server-side (it's not a browser-caching issue, OP)

it's part of why I'm in the habit of bumping the filename every time I update static resources, I just code my sites so there's only one file that references the actual resource URL and every other template includes the "common includes" template or whatever

there's a saying that there's only 2 hard problems in computer science: naming and cache invalidation. I mostly name my variables things like "fuck_you" and "your_mom_is_a_whore" so I'm not particularly opinionated as to the difficulty of naming things but when it comes to cache invalidation god DAMN I run into some tough issues


All times are GMT -7. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123