Closed scorninpc closed 2 years ago
Hey @scorninpc thanks for sharing; I'm not a cache expert, at a first view having redirects will not help with the speed. Most caching solutions replace the resources URLs in the HTML somehow. I would advise to post your question on stackoverflow or the like, where it could be viewed by folks that have a more hands-on experience with that.
Hello!
This is more a question/advice for security/fast way to cache than a problem. I see alot people looking for cache, so, sorry if this is a wrong place, but its nice to keep this documented here.
First i'm using gzip, so i done the workaround on htaccess
After that I redirect all css and js from
/modules/
directory to my PHPOn my PHP, I:
/cache/HASH
folder->gzip(HASH_FILENAME)
I think my logic is ok, but i'm in doubt if this redirect are ok
The browser target to
/modules/css/global.css
, i do the processes, save gziped file on/cache/css/526b0d2b64e1f1a76ebc41e457ca584e.cssgz
and redirect with header funcion to this new pathOn the second time, the browser target to
/modules/css/global.css
, and I redirect to/cache/css/526b0d2b64e1f1a76ebc41e457ca584e.cssgz
with header function with status 302Do you guys think this is a correct way to cache, or can we get some bether way?
The whole code