Advertisement:

Author Topic: H2PushResource; Apache2.4 ea70 7.0.33php MPMWorker w/HTTP2  (Read 499 times)

Offline drewactual

  • Full Member
  • ***
  • Posts: 653
    • College Football Fan Site CFB51
H2PushResource; Apache2.4 ea70 7.0.33php MPMWorker w/HTTP2
« on: February 03, 2019, 06:45:59 PM »
I thought i would share.  this may benefit someone here.

when h2 was fairly new i dabbled with it and 'push'.. i was already plating with preload. 

at one time i drafted several PHP files to include the 'preloads', but didn't see the benefit's that were supposed to happen. 

for a long time I've been using H2PushResource directive in .htaccess, but just for a combined and minified css and a combined and minified js.  it DID help, bringing my load times between 3/4 a second and a a second and a quarter, depending on what kind of mood the servers were in.  So.. that worked.  I DID NOT LIKE pushing to browsers every single time- it was/is a waste of bandwidth.

So today i set out to use the included php files again, and so i could use a cache buster on it... my page has gone through some changes lately for one, but also- i still have some users with really old files in their cache's. 

this made me play with the h2 diary's- to no real benefit... but that got me in to watching the files one by one in waterfalls... and something really DUMB struck me after a little while-

I DID NOT KNOW this... it's pretty large, actually... maybe some others don't know it too?

using the directive H2PushResource directive can ONLY be used with 'cacheable' items... meaning- I'm NOT pushing the files every time the user makes a request- those files are ABSOLUTELY cached and not pushed if they are present in the users cache and not expired (as handled in the expired directives). 

I dropped a 1/4 second off my load times after listing out each of the heavier items in a H2PushResource... it makes sense, as essentially  the Push only stages it in the cache so it's ready to go when needed- it goes directly to the cache unlike 'preload' which requires both the HTML to be parsed before sending it and it's done just before it's actually called. 

H2PushResources freakin' ROCKS.   give it a spin and see for yourselves if you haven't!!!