[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] auto-X.Y.Z.css



Hi both,

Here is my fix:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fcommit%2Fd940ee2ff8d3955010988bea8379cf1502eb8cda&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VJrvWAoYhV2h9C7MGZ9Np2xlgyer%2Bmlu%2Bn6dB4irSj0%3D&reserved=0

I am not sure if you want to patch.? This will probably need some 
adaptation if you are running 3.3, as the function in Repository.pm 
expects an inc file with flavours and ingredients, which is new for 
3.4.? I have also noted I took a rather odd approach using a ternary 
statement to update the $last_modified_time depending on whether the 
latest timestamp returned for the current directory is more recent.? 
There is nothing seriously wrong with this but I may fix it for 
something marginally more efficient.

Regards

David Newman

On 28/04/2022 5:38 pm, David R Newman via Eprints-tech wrote:
>
> Hi John and Yuri,
>
> This is the bane of my life as well, having to tell users to make sure 
> they "hard refresh" the page before complaining something is not 
> appearing/working as expected. So having a fix for this will save me a 
> lot of back and forth because I can be confident caching is not an issue.
>
> Therefore, I have created this GitHub issue:
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fissues%2F220&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FzYJQMzBCjPQFQRjHgBFXRlvxr9c4VW%2FMS53fugiLsE%3D&reserved=0
>
> I have half written this already, it should not take too long to 
> complete but may take a while to test to be confident it will do the job.
>
> Regards
>
> David Newman
>
> On 28/04/2022 5:29 pm, John Salter wrote:
>> *CAUTION:* This e-mail originated outside the University of Southampton.
>>
>> As a (hopefully useful) side note, the Apache Rewrite ruleset will 
>> honour URLs for the auto css and javascript that match e.g.
>>
>> style/auto-3.3.10.css
>>
>> style/auto-3.3.101.css
>>
>> style/auto-3.3.10999.css
>>
>> style/auto-3.3.100000.css
>>
>> - any amount of digits (but only digits) before the '.css' or '.js'.
>>
>> This can be used to force newer versions of the auto- files into 
>> browsers.
>>
>> For recent versions of EPrints, I think you can copy 
>> lib/cfg.d/template_core.pl into the archive config file.
>>
>> I would suggest changing this line:
>>
>> href => $repo->current_url( path => "static", 
>> "style/auto-".EPrints->human_version.".css" ),
>>
>> to:
>>
>> href => $repo->current_url( path => "static", 
>> "style/auto-".EPrints->human_version."1.css" ), #note '1' before '.css'
>>
>> Next time you need to force a different auto CSS or JS file, update 
>> the digit, or remove it!
>>
>> For older versions of EPrints (3.3.10, possibly beyond), where the 
>> loading of config files from various different directories worked a 
>> little differently, and overriding files from lib/cfg.d/ wasn't as 
>> simple as copying them to the local config, you could make a lovely 
>> hack, intercepting the template pins and adding extra digits to them:
>>
>> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fc5ae75d8cbafb902af8299ec57101d8c&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7mnxx31UaXqX84Mv5ciUzTh4dZFVLHLN2GmqYSfnvF8%3D&reserved=0 
>> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fc5ae75d8cbafb902af8299ec57101d8c&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=7mnxx31UaXqX84Mv5ciUzTh4dZFVLHLN2GmqYSfnvF8%3D&amp;reserved=0>
>>
>> I'm not /recommending/ the above hack - but we had it running like 
>> that without incident on 3.3.10 for a number of years!
>>
>> Cheers,
>>
>> John
>>
>> *From:*eprints-tech-bounces at ecs.soton.ac.uk 
>> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *David R 
>> Newman via Eprints-tech
>> *Sent:* 28 April 2022 16:50
>> *To:* eprints-tech at ecs.soton.ac.uk; Yuri <yurj at alfa.it>
>> *Subject:* Re: [EP-tech] auto-X.Y.Z.css
>>
>> Hi Yuri,
>>
>> This is in lib/cfg.d/template_core.pl.? This file may also be in your 
>> archive's cfg/cfg.d/ directory or possibly even the 
>> flavours/pub_lib/cfg.d/ directory if you are on 3.4.
>>
>> This is the block of code you need to update (around line 39):
>>
>> ?$head->appendChild( $repo->xml->create_element( "link",
>> ??????????? rel => "stylesheet",
>> ??????????? type => "text/css",
>> ??????????? href => $repo->current_url( path => "static", 
>> "style/auto-".EPrints->human_version.".css" ),
>> ??????? ) );
>>
>> Regards
>>
>> David Newman
>>
>> On 28/04/2022 4:41 pm, Yuri via Eprints-tech wrote:
>>
>>     CAUTION: This e-mail originated outside the University of Southampton.
>>
>>     Hi!
>>
>>      ? where's the code/template that generates the link in the head to
>>
>>     auto-X.Y.Z.css? I've modified it, but it is cached in the browser for a
>>
>>     month. I need to change it in order to people to get the changes without
>>
>>     asking them to clear the cache.
>>
>>     Thanks!
>>
>>     *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=4cduu3L7s8b%2FNiQ26Sg28bFwBiFqlxLdnHnIfGQW1yI%3D&amp;reserved=0>
>>
>>     *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Nkv3l3veuQkn%2FyX5EGz5oOzerAZZ2OrdO1nA5nu6ork%3D&amp;reserved=0!  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Nkv3l3veuQkn%2FyX5EGz5oOzerAZZ2OrdO1nA5nu6ork%3D&amp;reserved=0>
>>
>>     AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=qD%2Bac2q85kHMQ9C%2FngNKXI03jrGh0s52kqxiJefoXQs%3D&amp;reserved=0
>>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Nkv3l3veuQkn%2FyX5EGz5oOzerAZZ2OrdO1nA5nu6ork%3D&amp;reserved=0>
>>
>>     *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nC4YAD9JHoqYZXIBC25YYaXpkpnai09UDOCxl96QlPc%3D&amp;reserved=0!  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nC4YAD9JHoqYZXIBC25YYaXpkpnai09UDOCxl96QlPc%3D&amp;reserved=0>
>>
>>     uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Mjmd7ryQW69R5WYd6mS%2FU5JtKGpw%2FU3rB6EXpf8xMKE%3D&amp;reserved=0
>>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nC4YAD9JHoqYZXIBC25YYaXpkpnai09UDOCxl96QlPc%3D&amp;reserved=0>
>>
>
> *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Nkv3l3veuQkn%2FyX5EGz5oOzerAZZ2OrdO1nA5nu6ork%3D&amp;reserved=0
> *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C7880720936db4da5e2d908da29ab8b4f%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637868114011475669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=nC4YAD9JHoqYZXIBC25YYaXpkpnai09UDOCxl96QlPc%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20220429/43d60a3b/attachment-0001.html